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

Animation player jumps to the first frame after animation ends, instead of staying at the last frame #10480

Closed
idanarye opened this issue Nov 9, 2023 · 4 comments · Fixed by #10540
Assignees
Labels
A-Animation Make things move and change over time C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this!
Milestone

Comments

@idanarye
Copy link

idanarye commented Nov 9, 2023

Bevy version

Bevy v0.12.0

What you did

The problem happens when I start a non-repeating animation with the AnimationPlayer. I've created a repository that demonstrates the problem: https://github.com/idanarye/demonstrate-bevy-0.12-animation-bug

In the demos, hit the Spacebar to start the animation. If you run them in WASM you'll probably need to click on the canvas first before it starts accepting keyboard input.

What went wrong

Additional information

Note that I'm using the same glb file I used when I found the problem. I've tried to replicate it with a simpler glb file, but with no success. So it is possible that something is wrong with my glb file (which is very likely - I had to import some lost animation from an old export to the blender file, which could have messed things up), but since it works just fine in Bevy v0.11 there may be an actual regression in Bevy v0.12.

@idanarye idanarye added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 9, 2023
@nicopap nicopap added P-Regression Functionality that used to work but no longer does. Add a test for this! A-Animation Make things move and change over time and removed S-Needs-Triage This issue needs to be labelled labels Nov 10, 2023
@egsam98
Copy link

egsam98 commented Nov 10, 2023

I've also reproduced this error today

@sluedecke
Copy link

Same here after migrating from 0.11.3 to 0.12

@5tr1k3r
Copy link

5tr1k3r commented Nov 10, 2023

Saw that as well. I was using morph targets/shape keys animation.

@nicopap nicopap added this to the 0.12.1 milestone Nov 13, 2023
@nicopap
Copy link
Contributor

nicopap commented Nov 13, 2023

working on it

@nicopap nicopap self-assigned this Nov 13, 2023
github-merge-queue bot pushed a commit that referenced this issue Nov 14, 2023
# Objective

After #9002, it seems that "single shot" animations were broken. When
completing, they would reset to their initial value. Which is generally
not what you want.

- Fixes #10480

## Solution

Avoid `%`-ing the animation after the number of completions exceeds the
specified one. Instead, we early-return. This is also true when the
player is playing in reverse.

---

## Changelog

- Avoid resetting animations after `Repeat::Never` animation completion.
cart pushed a commit that referenced this issue Nov 30, 2023
# Objective

After #9002, it seems that "single shot" animations were broken. When
completing, they would reset to their initial value. Which is generally
not what you want.

- Fixes #10480

## Solution

Avoid `%`-ing the animation after the number of completions exceeds the
specified one. Instead, we early-return. This is also true when the
player is playing in reverse.

---

## Changelog

- Avoid resetting animations after `Repeat::Never` animation completion.
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
# Objective

After bevyengine#9002, it seems that "single shot" animations were broken. When
completing, they would reset to their initial value. Which is generally
not what you want.

- Fixes bevyengine#10480

## Solution

Avoid `%`-ing the animation after the number of completions exceeds the
specified one. Instead, we early-return. This is also true when the
player is playing in reverse.

---

## Changelog

- Avoid resetting animations after `Repeat::Never` animation completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Animation Make things move and change over time C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants