Thank you, and you didn't do anything wrong it's just a problem that I didn't know how to solve.
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