How do I add images etc. to the mouse cursor (without lag?)

Godot 4.4.1

Hey everyone :slight_smile:

I know there are some other threads on this topic (like this one) suggesting to use hardware cursor, but I’d like to show multiple UI elements at my cursor (images, progress bars, etc.) and thats really hard to realize with custom cursors.

Does Godot 4.4.1+ have any (new) features I can use for this?

You can use MOUSE_MODE_HIDDEN and track a TextureRect/ProgressBar/Sprite2D to the mouse’s position through a script.

Thanks for your reply gertkeno :slight_smile:

Hiding the mouse cursor sadly does not reduce the lag. Also I need to see the mouse cursor for the game.

Updating the node position in process/physics via
$Sprite2D.position = get_global_mouse_position()
is too slow. Disabling vsync and setting the fps limit to 120+ helps a lot, but theres still an noticeable amount of lag.

The post you linked described how to reduce input lag, it seems like you’ve followed most of the advice. That is the most you can do, without writing your own operating system.

You can hide the OS cursor and draw your own Godot cursor, it won’t look like it’s lagging anymore.