- Home /
Camera Rotation isn't synchronized with FPS Controller Rotation.
Hello,
I'm currently having a problem with a Standart First Person Controller. I use the Standart Asset and didn't change any parameters of the scripts and the error occurs in the Webplayer - not in Unity itself.
The Camera rotates faster than the character. When the scene starts, and I press W to run forward, everything works as expected. But when I turn my character for example 180° to the right and run forward again, the character runs to the left.
Any Ideas what that is and how I can fix it? I Am thankful for any help or hint!
I'm just having the same issue. There must be something wrong with the Input Class and the Web Player.
It was working fine with previous versions.
Answer by CgShady · Jul 22, 2013 at 09:58 PM
Ok, got it. Here goes :
for some odd reason, when in the WebPlayer, the Axes are reset to their defaults MouseXandY for both the Character Controller and its camera. (I love Unity's debugger !)
So, here's fix/hack
To be added to the Start method of MouseLook.cs
#if UNITY_WEBPLAYER
// HACK : fix for FPC mouselook issue in the webplayer
if (gameObject.CompareTag ("Player"))
axes = RotationAxes.MouseX ;
if (gameObject.CompareTag ("MainCamera"))
axes = RotationAxes.MouseY ;
// Debug.Log (string.Format ("MouseLook : {0} on {1}", gameObject.name, axes)) ;
#endif
This will force the settings upon start when compiling for Web Player
Note, this is not a web player bug, as application compiled with earlier versions of Unity work just fine. This seems to be a bug added to Unity somewhere between 4.1.x and 4.1.5
Cheers
Your answer
![](https://koobas.hobune.stream/wayback/20220613104315im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Keep the scene view rotation of my camera in play mode (it resets to 0) [EXAM ^^] 1 Answer
FPS Controller rotation,FPS Controller rotation problem 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
why is the mouse look messing up on the new fps character 0 Answers
How do you make a Raycast follow your mouse in an FPS? 0 Answers