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 resetting main spine rotation when playing animation #70123

Closed
Tracked by #73537
Cobradabest opened this issue Dec 15, 2022 · 4 comments · Fixed by #80813
Closed
Tracked by #73537

Animation Player resetting main spine rotation when playing animation #70123

Cobradabest opened this issue Dec 15, 2022 · 4 comments · Fixed by #80813

Comments

@Cobradabest
Copy link

Cobradabest commented Dec 15, 2022

Godot version

v4.0.beta8.official [45cac42]

System information

Ubuntu 20.04

Issue description

I have this weird bug where if I make a character model's skeleton seems to reset when I switch to another animation that doesn't use that bone.

To give context, I'm trying to make a Virtua Cop style game where the enemies show a death animation, but it stops and the enemies flash away. When I try to recreate this, it works fine in the editor, but in the actual game, it resets the main spine bone rotation, resulting in the error below. This didn't happen with me on Godot 3.5.

animationglitch

Steps to reproduce

  1. Import a glf or dae of a character with armature animations
  2. Make a new animation for it that doesn't use any of the bones
  3. Make it switch between an armature animation and the new animation in game

Minimal reproduction project

problem.zip

@Cobradabest Cobradabest changed the title Animation Player resetting main spine rotation when playing an animation that doesn't Animation Player resetting main spine rotation when playing animation Dec 15, 2022
@TokageItLab
Copy link
Member

Duplicate of #63465. Tentatively, you can use reset_bone_poses() to solve this problem.

@TokageItLab TokageItLab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
@TokageItLab
Copy link
Member

Oh sorry, I might have misunderstood, are you saying that the problem is that the bones are reset even though you are only using AnimationPlayer? If you are using AnimationTree, it will reset, but it seems strange that only AnimationPlayer is causing the reset. I will take a look at it later.

@TokageItLab
Copy link
Member

TokageItLab commented Dec 17, 2022

I investigated. It seems that this problem can be solved by making the scene instance containing the AnimationPlayer local by Make Local. Backport projects on alpha 5 seem to work even if it run on latest master. What the difference is is a puzzle to me, but I suspect that the dependencies have something to do with it...

_problem_backport.zip

I guess there is probably a referencing issue somewhere, but I don't know if this is what was intended. I will continue to investigate.

@TokageItLab
Copy link
Member

Ah, the problem is much simpler: the default_blend_time in AnimationPlayer was set to 0.5.

The blending algorithm has changed in 4.0, so blending is now based on the default value (rest in Skeleton). To resolve this, either temporarily set default_blend_time to 0 or use AnimationPlayer::stop(true).

@TokageItLab TokageItLab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2022
Repository owner moved this from To Assess to Done in 4.x Priority Issues Dec 17, 2022
@TokageItLab TokageItLab modified the milestones: 4.0, 4.1 Feb 17, 2023
@TokageItLab TokageItLab reopened this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants