I’ve followed a tutorial on how to add first person controls for mobile on the rigid body first person controller Here’s the tutorial if you want to know what I modified Touch FPS Controls in Unity 2018 🎓 - YouTube and I wanted to clamp the rotation of the y axis if you could help me it would mean a lot!
How do I clamp rotation for android fps game I am using the standard rigid body first person controller but a bit modified
Add a configurable joint, or in your case even a hingejoint would work.
joints are nice tools to limit movement of Physics objects.
Than you have some Limit options (limit axis angleor something like that). Further details look it up.