restrict the Y axis when Mouse Look disabled ?

hey guys ,

i used this code to disable the mouse look when user press p button then a menu show up :

GetComponent<MouseLook>().enabled=false;

to let the user select an option from that menu without the mouse movements
but it seems that just the x axis disabled but the mouse keep going on Y axis ?

is there a way to stop the whole movement of mouse look?

any idea please

did u found out? i have the same issue

so you’ll want a variable that becomes true when you press p that locks the x and y rotation and add it in at the top of your mouse look script. i will do some research and help later sorry i have work to do. sorry if i’m not much help i haven’t been using unity for long.

could you post your script for the mouse look?

i cannot do that right now, dont have the code here
but what i did was to go to unity editor open the player controller prefab and found out theres another Mouse look for y axis there
so ive used getcomponent to disable it