Help with getting rotation from world space velocity

I have a velocity of an object as a vector3 value and the velocity vector always changes. How do I change the rotation (Object.rotation) of the object based upon its velocity vector?
Note: The velocity is in world space

1 Like

If I understand correctly, I think you are trying to get the object to face the direction in which it is travelling? To do this it is rather simple. You could achieve this using a special CFrame constructor as so.

object.CFrame = CFrame.new(object.Position, object.Position + velocity)

The CFrame constructor that I used takes two Vector3 parameters. The first one indicates the position your part will be located in the workspace. The second Vector3 it the position in the workspace that you want the part to look at. This will orient the part so that the front face of the part will be pointing towards the second Vector3 given.

1 Like

Thank you so very much! I would have never guessed that, it works perfectly!

1 Like