Mouse leaves screen while playing game

Can someone help me?! I want the mouse to stay in the game (like mouse-lock) but it keep on frickin leaving

@grazer @“JR 01”

You cannot mouse-lock in Flowlab, so you just have to make sure that your mouse stays on screen. If it’s moving by itself, then it could be a problem with the mouse or the browser.

By the way, which game is this problem occurring?

Here @Superstargames

Yeah, that does seem strange. I think it could be because the mouse cursor object is not a user interface object. It is a game world object.
A game world objects will interact with the game world at all times. In your game, the cursor will always move at a position where it can obey the environment around it (like gravity and collision rules). However, if it was a user interface object, then the cursor object would not interact with the game world and will ALWAYS stay onscreen (or off-screen if the editor chooses so). This makes it easier for a user interface object to follow the player’s mouse.
As for the player object, I think it is because mouse move doesn’t track movements outside of the starting area. For example, your game has a screen size of 32x24. If the mouse moves at a coordinate outside of the 32x24 starting area, the game will still assume that you are moving your mouse there and not wherever it really is at. Thus, the player will point at the starting area rather than where your mouse really is. (This example may sound confusing, so hopefully you get it. If not, someone else can try to explain)

So how do i make it user interface?

See that tab at the bottom of the editor screen? There is an option called “Layer”. Set it to “User Interface”, then you can create objects in that layer. However, you would have to redo the mouse object, but you shouldn’t worry unless it takes ages for you to redo the mouse object.


Yeah, at this point I am not sure how to fix the Player’s behavior.

Okay, so I realized that expanding the world (with Camera block) is what messes with the mouse.

Thx @Superstargames

@grazer PLZ FIX DIS!

No problem!

Most recent by RageDayz