How do I limit my first person camera view?

I used the code from the tutorial. The problem is that when you look down for ever, the camera makes a 360 turn.

How can I fix that?

Thx in advance

Hi @SayHiToMePls,

You can clamp the rotation angle after it has been calculated. Something like this:

this.eulers.y = pc.math.clamp(this.eulers.y, -60, 60);

Thank you very much, it works

1 Like