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

Blending from one animation to another in AnimationPlayer while a longer blend is already active yields incorrect results. #70333

Closed
jitspoe opened this issue Dec 20, 2022 · 1 comment

Comments

@jitspoe
Copy link
Contributor

jitspoe commented Dec 20, 2022

Godot version

4.0 beta 9, 3.5 and earlier

System information

Windows 10, GLES 3

Issue description

If you play an animation with a long blend time and, while that blend is still happening, play one with a short (or zero) blend time, the long blend time will continue to be used (logic is sort of reversed). Also, if you played an animation with a 0 blend time while a blend was active, it still tried to blend.

In 4.x, the behavior is slightly different in that it will blend faster to the new anim, then pop back to the original anim and end up in the wrong location.

I already have a fix for this, but entering a bug to make it official. PR: #37001

Steps to reproduce

Have an AnimationPlayer with at least 3 animations.

Play animation 1.
Play animation 2 with a long blend time, like 5 seconds.
Play animation 3 with a short blend time, like .1 seconds.

Note that it doesn't blend to animation 3 in .1s.

Minimal reproduction project

Attached: https://github.com/godotengine/godot/files/10264210/test_anim_blend_g4.zip

func _ready():
	$test_anim/AnimationPlayer.play("up_front")
	var timer = Timer.new()
	add_child(timer)
	timer.wait_time = 1.0
	timer.one_shot = true
	timer.connect("timeout", start_anim2)
	timer.start()


func start_anim2():
	print("Starting anim 2")
	$test_anim/AnimationPlayer.play("up_side", 5.0) # 5 second blend time
	var timer = Timer.new()
	add_child(timer)
	timer.wait_time = 1.0
	timer.one_shot = true
	timer.connect("timeout", start_anim3)
	timer.start()


func start_anim3():
	print("Starting anim 3")
	$test_anim/AnimationPlayer.play("up_back", 0.1) # 100ms blend time (should be very fast)
@TokageItLab
Copy link
Member

Fixed by #37001.

@TokageItLab TokageItLab modified the milestones: 4.x, 4.0 Dec 22, 2022
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