So i’ve been working on this game for almost a year now and my biggest problem is that when im testing it, my mouse cursor will sometimes go off screen and onto my second monitor. Usually its fine you just move it back but if you click off the game and the go back, weird things happen like the player starts continuously moving in the last direction he was moving before you clicked off. Yes you can fix it by just pressing the key to move in that direction but the amoint of times playtesters have lost in my game because of this issue kinda makes it a problem. I’ve looked around and haven’t found anything to fix this issue. I guess i just need a way to lock the cursor to the screen when in full screen. (Its a 2d top down shooter by thr way)
Mouse pointer lock extension
Basically what they use how to move camera with mouse in 3D
Instead of tracking where cursor is it adds values based on X and Y mouse movement
You would create custom cursor object like just sprite object
And now add values to its position based on mouse pointer lock values
And this way you would prevent it from going off screen
Oh ok thanks so much. Ill try this out tomorrow. Ill let you know if it works ![]()
Im having a little trouble setting this up. Do you think you could send me a screenshot of some code for this?
Oh! Thanks so much! The only issue now is that it doesn’t follow the camera unless I place it on a different layer, which will break some things. It seems simple in my head but do you think you could show me h
Nevermind I found a work around
Thanks so much for your help

