how to get an object to point the direction it is moving in unity

I have no idea where to start scriting, how would I get the rocket to orient its self to the direction it’s moving?

The video is private.

3 Answers

3

If you apply a rigid body, you can check which direction it is moving by returning the rigidbody.velocity. If you want to face your object in that direction you can just say transform.forward = rigidbody.velocity.

But this question has been answered many times so please put in the effort and check before you ask.

And if he isn't using a rigidbody, he can just use transform.LookAt on the move operation.

Ok thanks, I hadn't thought about prior research, will next time

What do I do if the rotation is off by 90 degrees?

You subtract or add 90 degrees @SuperPurpleByte

You subtract or add 90 degrees @SuperPurpleByte