Godot GlobalTweens

Godot Version

4.x
I’ve created a global script that can help you create simple animations in Godot.

The script is called “tween”; just add it to the autoload and use any of its functions.

Async & Independent: Each tween runs independently; optionally await completion for sequential control.
Looping & Fire-and-Forget: Continuous animations (float, swing, spin, bounce) are easy to start and manage.
Customizable Transitions/Easing: Pass strings like “sine”, “back”, “elastic”, “quad” with “in”, “out”, “in_out”.
Safe & Robust: Automatically checks for valid nodes before tweening.
AutoLoad or Class Instance: Use globally or instantiate per scene.
Return Tween Objects: Every function returns its Tween for chaining or debugging.

GlobalTweens is a curated collection of animation helpers for Godot 4.x, built entirely on the native Tween system. It doesn’t reinvent the wheel, it wraps the patterns you keep rewriting across projects into declarative, safe-to-use functions with sensible defaults.

Instead of writing loops, timers, and manual interpolation, you just write:

GlobalTweens.spawn_in($Enemy)
GlobalTweens.shake($Player, 10.0, 0.3)
GlobalTweens.float_loop($Coin, 8.0, 2.0)
await GlobalTweens.scene_fade_change(get_tree(), "res://Menu.tscn")

What’s inside:

  • Batteries included: spawn, explode, fade, shake, typewriter, camera effects, light, UI, and much more.

  • Fire-and-forget: infinite loops (float_loop, spin, swing) that stop automatically when the node is freed, no dangling errors.

  • Built-in safety: every function checks that the node is still valid before acting.

  • Await-ready: every helper returns a Tween or PropertyTweener, so you can await to synchronize animations with game logic.

  • Flexible: use as a global AutoLoad or instantiate locally in a specific scene.

Who it’s for: devs who want polished, consistent animations without writing the same boilerplate every time. It doesn’t replace Godot’s Tweens, it packages them up to save you time.

This is a really big project. If you want to help me keep it going, you can. I think that together we can make it very flexible and useful for future developers.

More information on GitHub

2 Likes

How come you made it a node that needs to be added to the node tree?

What every tweening library for Godot could use is a list of features that make it better than built-in tweens. What you’ve listed on your post seems like what I could have without bringing in any additional libraries.

2 Likes

It’s a Node so you can set it up as an AutoLoad singleton (the recommended approach). The local instance alternative is just for those who prefer to avoid global singletons, but in that case you need a Node in the tree to call create_tween()

The value isn’t that you can’t do these with built-in tweens. It’s how much code you save. GlobalTweens.shake($Enemy) replaces 15+ lines of manual loops, decay math, and timers. float_loop($Coin) is a fire-and-forget infinite loop with built-in is_instance_valid safety. These are ready-to-use patterns with sensible defaults, not low-level primitives.

You realize Tween — Godot Engine (stable) documentation in English exists, right? And the wrapper functions you’ve mentioned are something you could easily do on top of Tweens with all customization your project may need.

Of course the Tween docs exist. That’s exactly the point: this library is built on top of them. Every wrapper exists because I got tired of rewriting the same 15-line shake, the same recursive float loop, the same scene transition boilerplate across projects. It’s not about hiding the Tween API it’s about not having to reinvent the wheel every time. If you prefer writing everything from scratch with full control, that’s totally fine. This is for people who’d rather type GlobalTweens.spawn_in($Enemy) and move on.

1 Like

I see, but in this case your initial post is extremely confusing as it describes built-in features on top of which you’ve built your project rather than what your project’s main goal is. A “collection of opionatated Tween helpers for 2D and UI nodes” would convey what you’re doing so much better.

That’s fair feedback, thanks. I focused on ease-of-use features in the post but you’re right, “opinionated Tween helpers for 2D and UI nodes” captures the spirit much better. I’ll update the description to make that clearer. Appreciate it.

1 Like

I think some more examples of how these can be used would be helpful too. Like a demo project on itch or something.

2 Likes

Sure I know, you can just visit GitHub and download Demo Project

Yes, you can. I’m just giving you advice based on my own experience making plugins - which is people will not download your demo project on GitHub.

1 Like

All right, actually, putting it on Itchio would be a great idea, because you can play it right in your browser.
I’ll do it right away, thanks.

2 Likes

Much better. I will say that a few of your tween examples would benefit from resetting after running. Otherwise you can’t test them twice. Also no way to stop the spinning one.

I though the color highlight on the text entry was really cool.

2 Likes

Thanks. As soon as I have a little time, I’ll try to create the best possible demo so we can run a proper test. I really appreciate it.:sparkles:

2 Likes

This belongs under “Resources”.
Right now it is in “help” and you aren’t really looking for help.
I recommend any follow up post be a new thread in that forum (or if you can get a mod to move this one there).

1 Like

How to ask mod?

@wchc can you move this for @Rpx?

2 Likes