Unity Asset Prefab Bug ThirdPersonController (left rotating bug / Snapping forward Always)

Alright guys,

I dont think I have done something wrong because I set a new scene, added one plane and added the untouched ThirdPersonController.

I took a video because it’s little hard to explain. If you face towards X Axes and then turning left, it does snap back to forward, turning right works fine.

Here is the video.

How to fix this…?

played more and figured out:

if you are in rotation 0 0 0
and you look forward. if you move down but with the right side (see picture) there is no snapping.

HOWEVER, if you move down using the left turn, it starts snapping.

JESUS, what crap is this?
How could be such a buggie Asset come from Unity -___-

is this supposed to be a feature?

Thanks for any help. Cheers :slight_smile:

thanks for any help :smiley:

I think the error is in the Atan() function in ThirdPersonCharacter.Move, which returns the value of Pi when move.magnitude = 0 in certain cases. It seems like it’s probably a trigonometry error where it should be returning 0. I fixed the issue with this code:

if (move.magnitude > 0f)
{
  m_TurnAmount = Mathf.Atan2(move.x, move.z);
}
else
{
  m_TurnAmount = 0f;
}

In my version the solution from reddit worked:
https://www.reddit.com/r/Unity3D/comments/2yz9i4/i_found_a_bug_in_the_third_person_controller_and/
if (turnAmount == Mathf.PI) turnAmount = 0f;

Hello,
check the Y-Rotation of your camera. If this Rotation is not 0 your character will always drift to the left/right when moving.

This fixed the drifting issue for me.

Best regards :slight_smile: