If the reflected angle (green) is greater than 50o, I want to change its direction for an angle of 45o (orange).public Vector2 direction = new Vector2(1,1);void FixedUpdate () { rb.velocity = direction * velocity;}private void OnCollisionEnter2D(Collision2D collision){ Vector2 normal = collision.contacts[0].normal; float angle = Vector2.Angle(direction, normal)); float angleComp = 180 - angle; Vector2 newDirection = Vector2.Reflect(direction, normal); newDirection.Normalize(); if (angleComp > 50) { newDirection = Quaternion.AngleAxis(direction.x * 45, Vector3.forward) * normal; newDirection.Normalize(); } direction = newDirection;} void DrawLine(Vector3 start, Vector3 end, Color color, float duration = 0.2f) { GameObject myLine = new GameObject(); myLine.transform.position = start; myLine.AddComponent<LineRenderer>(); LineRenderer lr = myLine.GetComponent<LineRenderer>(); lr.material = new Material(Shader.Find("Particles/Alpha Blended Premultiply")); lr.startColor = color; lr.endColor = color; lr.startWidth = 0.02f; lr.SetPosition(0, start); lr.SetPosition(1, end); //GameObject.Destroy(myLine, duration); } Each OS has theis own way to deal with New Line character.Win = CT LFMac = CRUnix = LFIn VS 2015 you go to:FileAdvance save optionsChoose the correct option for your OSIn VS 2017 you go to:FileSave AsClick the down arrow on the Save button and clicking "Save With Encoding...".Choose the correct option for your OSYou can also add it back to the File menu through Tools->Customize->Commands if you want to. A method to rotate a Gameobject towards a Vector3 position.void LookAt2D(Vector3 target) { // Get point B based on point A as 0,0,0 Vector3 targetDir = target - canon.transform.position; // Use Tangent to get the Angle. // Tan(x) = catetoOposto/catetoAdjacente float angleRad = Mathf.Atan2(targetDir.y, targetDir.x); // convert angle to Degrees float angleDeg = angleRad * Mathf.Rad2Deg; // I ll rotate "angleDeg" in "Vector3.forward" Axis canon.transform.rotation = Quaternion.AngleAxis(angleDeg, Vector3.forward); } An example of how to use Raycast to show the path where the Gameobject will pass.A tip is, you must disable Edit > ProjectSettings > Physics2D > Queries Start in ColliderThis mean that the Raycast will not collide with the Collider where it starts in.public int numPositions = 3;public Vector3 diretion = new Vector2(1, 1);public LineRenderer lineRenderer;void UpdateLineRenderer(){ Vector3 actualDirection = diretion; Vector3 actualPosition = transform.position; Vector3 lastPosition = actualPosition; lineRenderer.SetPosition(0, actualPosition); for (int x = 1; x < numPositions; x++) { RaycastHit2D hit = Physics2D.Raycast(lastPosition, actualDirection); lineRenderer.SetPosition(x, hit.point); lastPosition = hit.point; actualDirection = Vector3.Reflect(actualDirection, hit.normal); }}We can use the Debug.DrawRay to see the Raytrace:Debug.DrawRay(transform.position, diretion*100); A simple example of an object following the mouse in 3D environment.using UnityEngine;public class FollowMouse : MonoBehaviour{ public float force; Rigidbody ballRigid; Ray ray; void Start() { ballRigid = transform.GetComponent<Rigidbody>(); } private void Update() { ray = Camera.main.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(ray.origin, ray.direction * 100, Color.cyan); } void FixedUpdate() { RaycastHit hit; if (Physics.Raycast(ray, out hit, 100)) { if (hit.collider.tag == "Terrain") { Vector3 direction = hit.point - transform.position; ballRigid.AddForce(direction * force); } } }} Lerp is a very interesting function because it changes a value between X and Y incrementing (or decrementing) by a W value. If W varies from de beginning to the end, you can simulate an Ease In and Out too.In the example below, I want to go from 1 to 0 (fade effect) in 3 seconds.The for loop will take 3 seconds to complete and X will be an incremental value