Skip to content
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 parallel/chain behavior description is ambiguous #10305

Open
Meorge opened this issue Nov 22, 2024 · 0 comments
Open

Tween parallel/chain behavior description is ambiguous #10305

Meorge opened this issue Nov 22, 2024 · 0 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@Meorge
Copy link

Meorge commented Nov 22, 2024

Your Godot version: 4.4

Issue description:

As of my writing this, this is the documentation for the Tween.parallel and Tween.set_parallel methods:

Tween parallel()
Makes the next Tweener run parallelly to the previous one.

Tween set_parallel(parallel: bool = true)
If parallel is true, the Tweeners appended after this method will by default run simultaneously, as opposed to sequentially.
Note: Just like with parallel, the tweener added right before this method will also be part of the parallel step.

I was discussing the precise behavior of the Tween class's parallel functionality with another user, and we agreed that it seemed rather ambiguous. To demonstrate, consider the following scenario:

We create a new tween and add a PropertyTweener to it, then join it with another PropertyTweener, like so:

var tween = create_tween()
tween.tween_property(self, "rotation_degrees", 180.0, 10.0) # A
tween.parallel().tween_property(self, "position:x", 100.0, 5.0) # B

The tween's timeline so far would look like this:
Image

Now, we chain what we have with a third PropertyTweener:

tween.tween_property(self, "position:x", 200.0, 5.0) # C

It seems like there are two possibilities for how the timeline could now look:

  • Tweener C plays immediately after Tweener A (technically the "group" that both A and B are part of, but that A defines the total length of since it ends last). Thus, the total length of this Tween is 15 seconds.
    Image

  • Tweener C plays immediately after Tweener B, since B was the previous Tweener. Thus, the length of this Tween is 10 seconds, since B and C together play at the same time as A.
    Image

I created a small test project to find out, and Godot goes with the first case - A and B play simultaneously, and then once A is complete, C plays.

As it currently is, the documentation doesn't make this clear. I think it would be perfectly reasonable to think that C would run after B - in fact, I think that's more what the documentation implies. The wording should be improved so that the order of tweeners is clearer and more correct. If possible, I think it could also help to include small diagrams like what I've provided here.

URL to the documentation page (if already existing):

https://docs.godotengine.org/en/stable/classes/class_tween.html#class-tween

@tetrapod00 tetrapod00 added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

2 participants