#Player character rotation gets reset when moving

1 messages · Page 1 of 1 (latest)

limpid wolf
#

Im a beginner and followed the things Dave is showing in this video: https://www.youtube.com/watch?v=UCwwn2q4Vys

I copied the 2 scrips "PlayerMovement" and "ThirdPersonCam" to 100% but my player figure's rotation gets reset when i start moving. I recorded it to show you:

https://www.youtube.com/watch?v=DcrYeFIawpo

Anyone any idea why it happens and how to fix it ?

THIRD PERSON MOVEMENT in 11 MINUTES - Unity Tutorial

In this video I'm going to show you how to code full third person rigidbody movement. You can use this character controller as final movement for your game or use my other tutorials to build things like wall running, climbing, sliding, crouching and much more on top of it. (And of course you ...

▶ Play video
eternal sierra
#

the way alot of players move (and it appears the same on this one) is the root object's rotation doesn't matter.. its only moving around.. (thats why it's rotation isn't changing from 0, -90, 0) at all ..the rotations are actually happening on one of the children gameobjects (the graphics)

limpid wolf
eternal sierra
#

Say, your root object is the object thats moving..
and the 2nd object down the chain is rotating w/ the mouse inputs..

#

if u rotate it, so the blue axis is facing backwards.. (b/c say u want the blue cube part to be facing the other way)
its just going to snap back.. so the blue axis is where it was..

#

so instead you can rotate the graphics (even one step lower than the object rotating w/ mouse inputs)
now.. the blue cube is facing the same direction as the blue axis.. so even w/ the rotation script of the mouse inputs the graphics themselves are rotated.. and will match