- Home /
outdated
My camera flickers and it's driving me crazy
I have a third person controller prefab with 1 camera. In the editor it works fine when tested, but in the built .exe it's like there are 2 cameras (one looking forward and one looking up 60 degrees). The screen flickers between these 2 views. And the mouse look doesn't work. What could be wrong here?
Have you got any duplicate scripts? It's easy to duplicate/apply a script by accident.Add some Debug.Log to your scripts. See if you can track down any issues. Search in your Hierarchy with the exact script name to see.
Are you doing any weird rotation freezing? That can cause judders.
Answer by defactonline · Sep 09, 2013 at 02:45 PM
I know it's a late answer, but i had the same problem and fixed by deleting a secondary mouse look script in the project. It was from another plugin. It works fine now.
It's not late... Acutally I have only recently managed to find out it was about the $$anonymous$$OUSE LOO$$anonymous$$ SCRIPT. I had to delete it, and write a new one, following a tutorial video from YouTube. Now it works fine, but the up down directions are inversed. How could I fix that? What line in the script refers to that?
var lookSensitivity : float = 5; @HideInInspector var yRotation : float; @HideInInspector var xRotation : float; @HideInInspector var currentYRotation : float; @HideInInspector var currentXRotation : float; @HideInInspector var yRotationV : float; @HideInInspector var xRotationV : float; var lookSmoothDamp : float = 0.1;
function Update () { yRotation += Input.GetAxis("$$anonymous$$ouse X") lookSensitivity; xRotation += Input.GetAxis("$$anonymous$$ouse Y") lookSensitivity;
xRotation = $$anonymous$$athf.Clamp(xRotation, -90, 90);
currentXRotation = $$anonymous$$athf.SmoothDamp(currentXRotation, xRotation, xRotationV, lookSmoothDamp);
currentYRotation = $$anonymous$$athf.SmoothDamp(currentYRotation, yRotation, yRotationV, lookSmoothDamp);
transform.rotation = Quaternion.Euler(currentXRotation, currentYRotation, 0);
The UP DOWN directions are inverted. How do I change that in my script?
var lookSensitivity : float = 5; @HideInInspector var yRotation : float; @HideInInspector var xRotation : float; @HideInInspector var currentYRotation : float; @HideInInspector var currentXRotation : float; @HideInInspector var yRotationV : float; @HideInInspector var xRotationV : float; var lookSmoothDamp : float = 0.1;
function Update () { yRotation += Input.GetAxis("$$anonymous$$ouse X") lookSensitivity; xRotation += Input.GetAxis("$$anonymous$$ouse Y") lookSensitivity;
xRotation = $$anonymous$$athf.Clamp(xRotation, -90, 90);
currentXRotation = $$anonymous$$athf.SmoothDamp(currentXRotation, xRotation, xRotationV, lookSmoothDamp);
currentYRotation = $$anonymous$$athf.SmoothDamp(currentYRotation, yRotation, yRotationV, lookSmoothDamp);
transform.rotation = Quaternion.Euler(currentXRotation, currentYRotation, 0);
Answer by AttilaZold · May 14, 2013 at 12:34 PM
I am certain that there are no duplicate scripts applied because I deleted the old and added a new FPS controller prefab from the unity standard assets. Could you please give me and example of a debug.log so I can add it to the mouse look and character motor scripts?
Follow this Question
Related Questions
how to have 3rd person camera move like 1st person camera 0 Answers
Pause game camera movement s 1 Answer
Disabling Camera's "Mouse Look" while camera animation playing 0 Answers
How to make camera position relative to a specific target. 1 Answer
Controls Like the Mouse Look. Just without using Mouse 1 Answer