- Home /
Player Rotation
Ok, so I am having a little problem here with my rotation of my character.....
Here's the script..
Now the problem is here lines 43-48 or
if(Movement.mMoveDirection != Vector3.zero)
{
Quaternion Rotation = transform.rotation;
Rotation.SetLookRotation(Movement.mMoveDirection);
transform.rotation = Rotation;
}
When this is in my script my character is all weird
When I comment it out my character is fine but he wont adjust his rotation to the Movement Direction.. What am I doing wrong?!?!?!?
Unity's LookRotation() and LookAt() functions depend on your mesh being oriented correctly. Set your character's rotation to (0,0,0). He should be upright and facing positive 'z'.
If the mesh is correctly rotated, then put a Debug.Log() in to check the value of '$$anonymous$$ovement.m$$anonymous$$oveDirection'. It's 'y' component should be 0.0.
Just tried it's y position was at -0.4 as soon as I start the game and look the the character's properties his rotation changes to 90 on the x immediately.
Answer by xReaper7x · Feb 25, 2014 at 04:08 AM
I changed my method of movement so this is no longer needed! Thanks though to anyone that was going to help or did help! :D
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How do I create WASD controls for a fps? 3 Answers
I'm trying to make AI that walks (and faces) towards a waypoint 1 Answer
Free kick unity3d tutorial 1 Answer
Change Camera 3 Answers