How to make character face towards movement?,How to make character face towards the move direction?
Im definitely new in unity game dev
just wondering hot to make mu character facing towards the direction it's moving
in this code, im confused on how to use 2 of that rb transformation (commented is the running direction, uncommented is the character rotation) how to combine them?
void SwitchDirections()
{
if (rb.velocity.z > 0)
// rb.velocity = new Vector3(speed, 0, 0);
rb.transform.rotation = Quaternion.LookRotation(Vector3.left, Vector3.up);
else if (rb.velocity.x > 0)
// rb.velocity = new Vector3(0, 0, speed);
rb.transform.rotation = Quaternion.LookRotation(Vector3.right, Vector3.up);
}
Comment
Your answer
Follow this Question
Related Questions
How to Rotate player on Y Axis using Mouse position, but also Clamp the rotation distance? 0 Answers
Keep position of CharacterController relative to rotating platform 0 Answers
Make the character move along a curved road. 0 Answers
Rotate sphere to the direction of movement 0 Answers
Play animation when WASD is pressed, stop animation when none of them are pressed (Help!!) 0 Answers