How can I create a looping tween? On the Godot Docs (or as I like to call them, the Godocs)
it says:
Warning: Make sure to always add some duration/delay when using infinite loops. To prevent the game freezing, 0-duration looped animations (e.g. a single CallbackTweener with no delay) are stopped after a small number of loops, which may produce unexpected results. If a Tween’s lifetime depends on some node, always use bind_node().
How can I do this? I want my coin to bob up and down. This is my code, why doesn’t it work?
That warning just means that you shouldn’t have infinite looping tweens with no duration or delay. In your case, each tween_property() has a duration already so it won’t cause any issues.
If you want to add a small delay between tweening different properties then you need to use PropertyTweener.set_delay()
And, as @tibaverus said, you are tweening to the same value both times so it won’t bob.
BTW, the wait() function is not the correct way to do it . More info about how to correctly setup it here: