I want to make tilt angle lock..

im new on the scripting. sorry 4 this question. can anyone tell me how to make tilt angle lock?

You can use constraints

rigidbody.constraints = RigidbodyConstraints.FreezeRotationX (or Z,Y)

i dont know to use. where must i write this ?

i want to lock cameras tilt angleā€¦ please help.