- Home /
Facing direction of missile
Hello there,
I've got a sphere/globe that I'm firing a missile around and I've got the trajectory correct with orbit at the appropriate height but I'm having issues getting it to face the current direction of travel.
I've tried - transform.localRotation = Quaternion.LookRotation (missile.velocity, Vector3.forward);
missile being the parent object - where I'm getting the rigidbody current vector3 velocity transform being the child object representing the missiles body.
Any hints appreciated!
Thanks
I guess I have a different issue. The object with the rigid body is moving but the velocity is showing up 0,0,0. Which would be why the objects not rotating.
Answer by RLin · May 21, 2015 at 01:20 AM
If the missile has a rigidbody, and that is what control's its flight, use rigidbody.centerofmass to set it much higher in the missile, this will make the point always face its direction of travel.