+1 vote

Hi!, i'm currently working on a dark adventure game in Godot, for inmersion purposes i've decided to create my own cursor which is a hand. I'm using an animated sprite that follows my mouse around and is working great.

Only issue i have is that the mouse shows when i start the game, until the user moves it at least one pixel.

This is the code i use upon cursor initialization
enter image description here
The cursor is a singleton global that is loaded on the proyect globals

This is how it looks when i start the game
enter image description here

This is fixed when i move the mouse just a tiny bit
enter image description here

Maybe it has something to do with the active window?, maybe when the game loads the window (since it is windowed) is not the active and so the mouse hide setting is not taking effect since now it only affects the cursor inside the game (because for instance i can see the original mouse in the title bar).

Any help will be very appreaciated. Also wanted to add that i don't have a splash screen or loading. Thanks in advance :D.

P.D: Tried setting the mouse mode in each scene that uses the cursor individually and didn't work either.

in Engine by (33 points)

Try using Viewport and Input warp_mouse methods when game starts, maybe that could update the cursor too.

Or you can set a transparent image as custom cursor on project settings>display or with Input.set_custom_mouse_cursor.

Hi @eons! thanks for the reply, i tried all three methods, forgot to mention i had already tried with Input.warp_mouse() to no avail, i testing with the display and setting a transparent custom cursor on project settings, didn't work eiher.

No worries it's not a big thing but i just thought it would look more profesional if the default windows cursor never shows hehe.

I'm still puzzled if it has something to do with the "active window" in Windows because when i click even if i don't move it it's fixed is like its not focused when the game launches. Happens the same from the debugger and exported proyect but no biggish, thanks for the tips, if you think of another option i would be glad to give it a try :-). I'm really out of ideas lol.

There seems to be some bugs related to that (custom cursors and visibility), is supposed to be fixed by 3.0.

A hacky solution could be to warp the cursor outside the window, so the player is forced to move it at least once ^_^;

Hehehehe that could be an option, not bad. Awesome thanks for the heads up regarding the 3.0 i'll keep my ears open for that one.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.