0 votes

Hi guys. i'd like to change my cursor (preferably by a Singleton, so i can change it anytime). Is there any way to change it to an Animated Sprite?

in Engine by (17 points)

1 Answer

+1 vote
Best answer

You can't use an animated hardware cursor, but you can use a software cursor that's represented by an AnimatedSprite (or Sprite + AnimationPlayer). Simply move the sprite's position every frame in _process() to the cursor's position. Keep in mind there will be an 1-frame lag compared to an hardware cursor, which makes this a bad idea for fast-paced games.

by (9,104 points)
selected by

Can't you do it with _physics_process(delta) and it will be every frame or will that be the same?

On high refresh rate monitors, it will be even worse if you use _physics_process() instead of _process() to move the cursor.

One way you could use to decrease the perceived latency is to extrapolate the cursor position, but doing so will introduce jittering.

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.