- Home /
Slight Problem in the Camera Rotation Script
Hi all,
I am Trying to implement a 360 degree rotation around an object through Mouse drag. As I am new to Unity Scripting I have mainly used if loops to implement the concept.
I have attached the script to the empty game object holding the Camera. I have almost implemented the concept but I am facing problem to Tilt the camera using right mouse button within a range(I have used Camera height value 4 to 1 in this case)
I have placed the following code inside Update(). It will come to this piece of code only if the right mouse button is pressed. Everything seems to be working properly except the tilting is going below the the range 1.
It is stopping the tilt at 1 but subsequent attempt to push it down or holding the mouse button for long time seems to take it below the range 1. But the same is not happening with higher range i.e. 4.
Why is this happening? Is it because I have used it inside Update()? What is the alternative? or where am I going wrong in implementing this?
post it again as text and Ill play with it.. don't post pictures of code thats not that helpful if the problem isnt obvious