0 and 360 are not the same. Tween doesn’t know or care that it looks the same to us. It operates only on numbers and 0 and 360 are not the same number. As I said, print the initial value and print the actual value every frame in _process()
An obvious reason for this code to do nothing would be that it doesn’t run at all.
After a little bit I found why it wasn’t working. I put the script from a node into a sprite2D and forgot that the sprite didn’t have the “twinkle” thing in it. I just moved it to a node and made the original sprite the twinkle and it worked
Ok, maybe it works now, but that was an issue I encountered in the past with tweening a spinning throwing dagger. I ended up using an AnimationPlayer to solve the problem.
If animation player can do it, tween should be able to do it as well. Afaik rotation properties are not automatically clamped to 2pi range. Don’t remember how Godot 3 behaved in this respect.
If you have code that spins something 360 degrees over and over again I’d love to see it. This is an ongoing problem for me in a game I am working on. Here’s my code that didn’t work:
If we want to get really nitpicky, the above example is not endless. It will eventually go out of whack if we leave it run for months. Rotation will become a very large number and floating point precision will start causing issues. Nevertheless, it’s good enough for most use cases.
Here’s an alternative that’s truly endless and could go on until the collapse of the universe