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

Unexpected set_parallel behavior in SceneTreeTween #69264

Open
firebelley opened this issue Nov 27, 2022 · 3 comments
Open

Unexpected set_parallel behavior in SceneTreeTween #69264

firebelley opened this issue Nov 27, 2022 · 3 comments

Comments

@firebelley
Copy link

Godot version

3.5.1.stable.mono

System information

Windows 11

Issue description

The set_parallel function of SceneTreeTween explicitly states that "Tweeners appended after this method will by default run simultaneously, as opposed to sequentially."

However, this is not the case. A tween defined before the call to set_parallel appears not to run at all. Or perhaps the tween defined after set_parallel is being run prematurely thus overriding it.

# Root node is a ColorRect
var tween = create_tween()
tween.tween_property(self, "color", Color.black, 1)
tween.tween_property(self, "color", Color.white, 1)
tween.set_parallel()
tween.tween_property(self, "color", Color.red, 1)

In the above snippet, I expect the following to happen:

  1. Tween the ColorRect to black over 1 second.
  2. Tween the ColorRect to white over 1 second.
  3. Enable parallel execution
  4. Tween the ColorRect to red over 1 second.

However, the observed behavior is instead as follows:

  1. The ColorRect is tweened to black over 1 second.
  2. The ColorRect is tweened to red over 1 second.

In the observed behavior, the transition back to white never happens. The tween goes immediately from black to red, despite the fact that a tween to white is specified before set_parallel is called.

Steps to reproduce

See issue description or minimal reproduction project.

Minimal reproduction project

SceneTreeTween Issue Example.zip

@KoBeWi
Copy link
Member

KoBeWi commented Nov 27, 2022

set_parallel() has the same immediate effect as parallel(), i.e. the next Tweener will run in parallel to the previously defined one. In your case white and red animations happen at the same time and red is overwriting the color, because it's animated later.

Maybe the description needs some clarification.

@firebelley
Copy link
Author

firebelley commented Nov 27, 2022

Yeah that doesn't make sense given the description. The description of set_parallel only mentions tweens set after the call. Arguably it should not have any immediate effect. Otherwise every tween defined immediately prior to the call will be parallelized which, I would guess, would be undesired in almost every case. At the very least it's not intuitive.

@Lippanon
Copy link

This seems to be the 3.x version of #74608. In 4.x the documentation was addressed by #79758.

@KoBeWi KoBeWi added this to the 3.x milestone Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants