I clamped rotation of my FPS character but it can still pas the max or min value then it snaps back

FidgetSpinnerKid
vertex
in Unity
When I pull the mouse down character looks down and it should stop in some point so I made maximum and minimum values for the rotation with mathf.clamp but this time. When I look down it passes maximum value or minimum value then it comes back to max value and this keeps repeating itself until I stop moving my mose.
Replies
-
you need to show some code if you want help
-
-
literally unbelievable post.
-
lol it was becouse of order of the script that is why it was not working xd
-
Why are you searching the "Ads" component twice on every frame? Just search for it on Start or Awake and store it in a variable.
-
Becouse there is a bool and that is connected to another script I might aim anytime and Isn't it going to take the first value if I put it to the awake or start that value keeps changing
-
I know. But finding the gameobject each frame is much slower then storing a reference on start and then checking the reference.
-
I'll do that then I am not a coder I am just learning