AnimationPlayer.play stopped working with 4.3

Godot Version

4.3.stable

Question

Running into a really frustrating issue where one of my animations has simply stopped working in the game.

Essentially, I have this really simple code

extends Node3D

# set from the animation to prevent double playing
#var _playing = false

@rpc("call_local", "any_peer")
func play():
	#if _playing == true: return
	$AnimationPlayer.play("slash")

_playing was just a prop I was modifying from the animation track to prevent spamming. It looks like we no longer get to set props from the animation tracks? Either way, it shouldn’t matter anyway so I commented it out and removed that track.

I can see that my code execution is getting to this point, a print statement just above the play statement will show up.

So, the problem is super frustrating because I have no way to debug this. I get to the play call and nothing happens. Before I updated from 4.2 it was working just fine, but now it does nothing.

Selecting my animation slash from this dropdown renders the animation as I’d expect in the 3D view.

Did something change about this API where I can no longer just call $AnimationPlayer.play()? Thinking some obscure change to AnimationMixer caused this I’ve tried toggling pretty much every option in there to no avail.

Comparing it to other animations in my game that also use the play() API I see no difference here. Completely out of ideas on what to try to fix this…

Interesting development in debugging this:

extends Node3D

# set from the animation to prevent double playing
@export var _playing = false

@rpc("call_local", "any_peer")
func play():
	if _playing == true: return
	print("Should play")
	$AnimationPlayer.play("slash")

func _process(delta):
	if _playing == false:
		$AnimationPlayer.play("slash")

I’ve added this code in _process and the animation does indeed play! Also, when clicking you can see the console log “Should play”, but it still doesn’t play (even when commenting out the process code)

What the heck!! The callstack that leads to this “play” function being called is from _process on the player character. So if it’s getting there and also from process why wouldn’t it work @_@

Aha, epic face-palm moment.
image

I had turned off visibility to debug some other visual stuff T_T
wasted several hours chasing my tail lol

for someone who may find this in the future. If your animations aren’t showing up, make sure their game object is not hidden!!

You can check with print(visible) or just look in the scene tree for the eye icon

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.