How to rotate object to match the direction of another?

I have the following prefab that is shown whenever the ball is off screen.

205826-screenshot-2023-03-24-142639.png
205827-2.png

I want to rotate the blue arrow so that it “trails” the movement of the ball. As in when the ball is moving up and right, the point of the arrow is down and left.

I tried to accomplish this by setting the rotation of the DirectionIndicator to the LookRotation of the normalized velocity vector of the ball. (in the Update function)

directionIndicator.transform.rotation = Quaternion.LookRotation(ball.GetComponent<Rigidbody>().velocity.normalized);

This causes my Sprite object to get lost for some reason. (Shown way below my prefab in the editor after I click run.) I thought maybe the issue was that I needed to set the locatlRotation instead, but that causes my Sprite to fly across my screen and doesn’t seem to be influencing “local” at all.

How can I rotate the Sprite object around it’s parent correctly?

You should almost be there with the code you supplied, but that is assuming that the blue indicator has the trail direction aligned with its transform forward. Additionally, “LookRotation” assumes that your up vector is aligned with the world Vector3.up (0,0,0) unless you supply it. So based on your situation, I think you should pass the up vector as the camera -transform.forward. Again, this depends on the indicator having the blue point aligned with the transform’s forward vector and so you might have to pass the negative normalized velocity as well. since the point should be opposite to the direction the ball is travelling, but maybe if you have the forward vector of the blue indicator pointing towards the ball travelling than you can keep that as it is

directionIndicator.transform.rotation = Quaternion.LookRotation(ball.GetComponent<Rigidbody>().velocity.normalized, -Camera.main.transform.forward);