-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tween_interval() works strangely with set_parallel() #74608
Comments
cc @KoBeWi |
I believe this is intended behavior. The documentation could be improved. The tricky part is how "parallel" works, it's relative to the previous tweener instead of the next one. tween.tween_property(self,"scale",Vector2(2,2),1) # starts after the previous ones finish
tween.tween_interval(2) # starts after the previous ones finish
tween.set_parallel()
tween.tween_property(self,"position",position +Vector2(50,50),0.3) # starts together with the previous one
tween.tween_property(self,"modulate",Color.RED,0.3) # starts together with the previous one So conceptually:
|
|
Perhaps this should be reopened? At the very least, the documentation seems to still be misleading on this matter. I just spent a good deal of time trying to work out why my tweens weren't happening in the order I expected. 😖 I think it would be a lot more intuitive for tween.tween_property(self, "scale", Vector2.ONE * 2, 1.0)
tween.tween_property(self, "position", Vector2.ZERO, 1.0)
tween.begin_parallel() # Everything after here is parallel
tween.tween_property(self, "position", Vector2(100, 100), 1.0)
tween.tween_property(self, "scale", Vector2.ONE, 1.0)
# vs
tween.tween_property(self, "scale", Vector2.ONE * 2, 1.0)
tween.tween_property(self, "position", Vector2.ZERO, 1.0) # Everything after here is parallel
tween.tween_property(self, "position", Vector2(100, 100), 1.0)
tween.set_parallel() # But you don't know that until you get here
tween.tween_property(self, "scale", Vector2.ONE, 1.0) |
To prevent compatibility breakage, perhaps 2 new methods could be added: |
Godot version
4.0.stable
System information
Win10
Issue description
The sequence of execution of this code in my imagination is:
ColoRect
first magnifies thescale
to twice in 1 second, and then after a delay of 2 seconds, it simultaneously changes itsposition
andmodulate
to the specified value in 0.3 seconds.But the fact is that after taking a second to adjust its
scale
, it skippedtweet.tween_ Interval (2)
sets the 2-second delay. Instead, it directly start modifyingposition
andmodulate
.It looks like set_parallel() will execute the previous IntervalTweener at the same time.
But the description in the document is as follows:
I don't know whether my understanding is wrong or there is a bug here.
Steps to reproduce
You use the code in the above question to reproduce.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: