ERROR: Invalid call to function "is playing" in base "AnimatedSprite". Expected 0 arguments

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pointlessperson1

I`m trying to animate a character when they start walking and when they stop. Here is the code causing the problem

if $AnimatedSprite.is_playing ("walkright") == true and motion.x == 0:
	$AnimationPlayer.play("idleright")

I`m not sure what could have caused it could someone please help me out

:bust_in_silhouette: Reply From: starzar

$AnimatedSprite.is_playing() checks if the animated sprite is playing and returns a ‘bool’(true/false) depending on whether the animated sprite is playing or not .
It does not accept any inputs.

Instead use

$AnimationPlayer.current_animation == "animation_name"