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 didn't repeat anymore after being stopped then started again. #40679

Closed
jmb462 opened this issue Jul 24, 2020 · 7 comments · Fixed by #46609
Closed

Tween didn't repeat anymore after being stopped then started again. #40679

jmb462 opened this issue Jul 24, 2020 · 7 comments · Fixed by #46609

Comments

@jmb462
Copy link
Contributor

jmb462 commented Jul 24, 2020

Godot version:
This bug was introduced in 3.2.3 RC1
Probably with this commit : 8ef40b9 ( "bug with Tween.is_active, fixes #39760" )

OS/device including version:
Windows and Mac. Not tested under Linux OS

Issue description:
When a tween is stopped using Tween.stop() and then started again with Tween.start(), the tween never repeat even if Tween.repeat is true.

Steps to reproduce:
Configure a tween with repeat true.
Start it (tween is looping normaly)
Stop it.
Start it again (tween never repeat even if Tween.repeat is still true.

Minimal reproduction project:
Here is a minimal projet :
tween_bug.zip

@fabriceci
Copy link
Contributor

fabriceci commented Aug 25, 2020

The bug's fix 8ef40b9 introduce a vicious bug on my game. In some case when I launch a Tween, it interrupts and emits a completed signal just 3ms after the launch. Unfortunately, I was unable to reproduce the issue in a new project.

@akien-mga
Copy link
Member

I reverted the cherry-pick of #39801 with 2d42625, which should fix this issue for 3.2.3 (reintroducing #39760).

#39801 is not reverted in the master branch so the issue is still valid there, we can look for a bugfix first and then decide if we can fix both #39760 and the present issue, or if a revert is also the better option there.

@jmb462
Copy link
Contributor Author

jmb462 commented Aug 25, 2020

To complete fabriceci comment, this new problem happens when Tween.remove_all() is called when the tween is not yet active.
It prevents the next tween to be processed and finished_all signal is directly emitted when tween is launched.
I don't know if it deserve another issue because 3.2.3 and 4.0 are not synchronised anymore about the tweens issues.

Here is a minimal project for the bug that fabricci is talking about.

bug_tween_3_2.zip

@akien-mga akien-mga changed the title [3.2.3 RC1] Tween didn't repeat anymore after being stopped then started again. Tween didn't repeat anymore after being stopped then started again. Sep 8, 2020
@PseudoDistant
Copy link

PseudoDistant commented May 31, 2021

I'm still having this issue.
I last updated Godot Engine on May 7, 2021, and I'm having this issue with tweens.

if Input.is_action_just_pressed("input"):
    if booleanValue:
      tween.interpolate_property($Sprite, "self_modulate", Color("ffffff"), Color("b72424"), 1, Tween.TRANS_SINE, Tween.EASE_IN_OUT)
      tween.start()
    else:
      tween.stop($Sprite, "self_modulate")

It repeats correctly the first time, but every other time after it stops it doesn't loop. ;-;

@jmb462
Copy link
Contributor Author

jmb462 commented May 31, 2021

A PR is already merged on master branch and a PR for 3.x branch is done but not merged yet because @akien-mga said it was submitted too late before the 3.3 release and it was risky to merge at that time. #47142

@nightblade9
Copy link
Contributor

I just ran into this and it's quite problematic for me in 3.3.3. (Stopping and starting the tween, doesn't start it.)

  1. Is this still slated to be fixed in 3.4?
  2. Is there any work-around for this right now?

@jmb462
Copy link
Contributor Author

jmb462 commented Sep 13, 2021

The fix is already merged in 3.x branch (so included in future 3.4) but still not cherrypicked in 3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants