You just have to lock the mouse cursor at the beginning. It's like 1 line of code. Search it up.
I also try that but it doesn't unlock when scene changes