- Home /
look at movedirection
Hi how can i do, those the player model rotate in the move direction, and forward is Cam forward ?
I have here some examples, but neither work so like i need it.
1, the model rotate in movedirection but if i stop it rotate back to start pos.
playerModel.transform.forward = playerRig.velocity;
2, the model rotate in movedirection but if i stop it rotate back to start pos, and ignor the camera forward
Vector3 movement = new Vector3(input.x, 0.0f, input.z);
playerModel.transform.forward = movement;
3, the model rotate to camera forward but not to movment forward
playerModel.transform.forward = CamRotatePoint.transform.forward;
i need combination of this, or what other working thing.
Answer by firegate666 · Mar 03, 2020 at 09:03 PM
This here
playerModel.transform.forward = playerRig.velocity;
but do a zero check
if (_rigidbody.velocity != Vector3.zero)
{
_rigidbody.transform.forward = _rigidbody.velocity;
}
this is what solved it for me
Your answer
Follow this Question
Related Questions
Keeping transform.forward facing forwards 1 Answer
Trying to make a Projectile Rotate and Move Forward.. 1 Answer
Accelerating in Turned Direction 2 Answers
Help with rotating a sprite with mouse. 2 Answers
Change movement speed based on rotation 0 Answers