Attempt to call function 'play' in base 'null instance' on a null instance.

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

i’m gaving an error and i tried everything and it doesn’t work
here is my code:

# checks the state of the player aka skin
func skin_change():
	if player_skin == 0:
		if !is_on_floor():
	elif player_skin == 1:
		if !is_on_floor():
:bust_in_silhouette: Reply From: SteveSmith

It’s difficult to answer because you don’t say which line has the error, but either $AnimatedSprite or $AnimationPlayer doesn’t exist relative to the node which has this code.

the error is at “$“duck_collision”)”

Ceo-Potato | 2023-01-15 09:33

It’s $AnimationPlayer then.

SteveSmith | 2023-01-15 09:44