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

AnimationTree: Frame has mixed information when using both continuous and discrete animation tracks while auto transitioning in AnimationNodeStateMachine #75373

Closed
Akatuoro opened this issue Mar 26, 2023 · 1 comment

Comments

@Akatuoro
Copy link

Godot version

v4.0.stable.official.92bee43ad and v4.0.1.stable.official.cacf49999

System information

Windows 10

Issue description

In an AnimationNodeStateMachine, when transitioning between animation states (with 'At End', 'Auto'), there is a single frame glitch showing a mix of the old and the new animation (old region_rect and new frame for a Sprite2D). The region_rect track has 'Update Mode' 'Continuous' while the frame track has 'Update Mode' 'Discrete'.

When changing the animation directly on the AnimationPlayer (via timer), it correctly shows the new animation.

reproduce-animation-bug.DEBUG.2023-03-27.00-25-11.mp4

When logging the changing region_rect and frame values in _process, the frame is also visible:

# using AnimationNodeStateMachine
region x: 64, frame: 0, anim:   blue12, pos: 0.008333
region x: 64, frame: 1, anim:   blue12, pos: 0.400000
region x: 64, frame: 0, anim:  black12, pos: 0.000000   # this is unexpected
region x:  0, frame: 0, anim:  black12, pos: 0.008333
region x:  0, frame: 1, anim:  black12, pos: 0.400000
region x:  0, frame: 0, anim:   blue12, pos: 0.000000   # here as well
region x: 64, frame: 0, anim:   blue12, pos: 0.008333
region x: 64, frame: 1, anim:   blue12, pos: 0.400000
region x: 64, frame: 0, anim:  black12, pos: 0.000000   # etc.
region x:  0, frame: 0, anim:  black12, pos: 0.008333
# using AnimationPlayer.play()
region x:  0, frame: 1, anim:  black12, pos: 0.400000
region x: 64, frame: 0, anim:   blue12, pos: 0.008333
region x: 64, frame: 1, anim:   blue12, pos: 0.400000
region x:  0, frame: 0, anim:  black12, pos: 0.008333
region x:  0, frame: 1, anim:  black12, pos: 0.400000
region x: 64, frame: 0, anim:   blue12, pos: 0.008333
region x: 64, frame: 1, anim:   blue12, pos: 0.400000
region x:  0, frame: 0, anim:  black12, pos: 0.008333

Switching the 'Update Mode' to 'Discrete' for the region_rect animation track fixes the glitched frame. But that inhibits other functionality, so my expectation would be that the animation state transition also behaves coherently with 'Update Mode' set to 'Continuous'.

Steps to reproduce

Create 2 animations in an AnimationPlayer, each with a track for region_rect and frame on a Sprite2D:

anim1

anim2

Then create an AnimationTree with an AnimationNodeStateMachine that automatically transitions between these animations with switch mode 'At End':
animtree

Minimal reproduction project

reproduce-animation-bug.zip

@TokageItLab
Copy link
Member

Closed by #86629 (or previous)

@TokageItLab TokageItLab added this to the 4.3 milestone Jul 9, 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

2 participants