- Home /
ThirdPersonController Player spins on axis joypad input.
I have created a fresh scene, Created a platform for my player to stand on and attached the latest version (7/01/2011) of the included ThirdPersonController Component to the player. There is also a camera with ThirdPersonCamera component which is almost working as expected.
As I apply positive force on the X axis of my xbox controller the player moves forward normally, but as I apply a small amount of positive or negative Y input the character begins to turn slowly until I reach the 1.0/-1.0 threshold where the player then begins to rotate on what looks like 90 degree intervals. I will attach a video of this when I get home from work.
I have a feeling what is happening is the Quaternion position is being set to behind my character and he's trying to turn to look at it but I don't know enough about the math or the functions available to 'try' things to fix the problem. (http://unity3d.com/support/documentation/ScriptReference/Quaternion)
Any advice? Thanks.
Answer by Adrian Love · Jan 16, 2011 at 04:10 AM
Okay, So after powering through I found out I had missed the intended structure of the scene. The ThirdPersonController and ThirdPersonCamera components both go onto the player and the camera and player sit side by side in the heirachy.
I thought it might have been an issue with the isGrounded() function which uses the collideBottom flag. it was switching on and off and I thought it might have been causing weird issues with air movement but it turns out the left and right are detirmined by the cameras position so as the child camera moved so did the new target direction.
Powering through problems solves them!
Your answer
Follow this Question
Related Questions
Moving an object in a circle towards joystick 0 Answers
How to make a cube rotate around player depending mouse position using New Input System 0 Answers
Best way to prevent unnecessary input handling? 1 Answer
How to get smooth analog joystick rotation without "snapping"? 2 Answers
Get in turret by pressing a Key 0 Answers