Set the mouse pointer

Goodmorning everyone. How can I set the mouse pointer to a certain coordinate?
Example. The mouse pointer was left by the user at the 40x, 40y coordinate. The program should now move the mouse pointer to 100x, 80y.

(I tested the commands “MouseX”, “MouseY” … I read the wiki and searched this forum, but couldn’t find the answer)

You can not force the mouse pointer to be somewhere. The mouse pointer is a OS controlled item, not a game engine controlled one.

You could potentially fake it by using a custom mouse pointer sprite (refer to the Custom Mouse pointer example), then use conditions to move that sprite wherever you want. The OS mouse pointer will be hidden-in game, so the player wouldn’t have anyway to know the difference.

1 Like

But it’s not gonna acting like a real mouse pointer. You’re not be able to click on an object, because the action will only move the image not the position of mouse that is hidden.

1 Like

Nah, it can still work fine.

You just use “Mouse button is down” in combination with “FakeMouseSprite is in collision with whatever” instead of the “Mouse is over blah” condition.

Sure, I meant the real mouse pointer wont move.

1 Like

Thanks Silver-Streak, but I need the “real” mouse pointer to move, even if its image doesn’t show, I really need it to point somewhere else. Okay, thanks for the explanation, now I know I can’t act this way, so I’ll have to devise another way to get that result in my game :slight_smile:

Thank you all, this question is solved for me.