Help me pls
Invalid call nonexistent function play gdscriptnativeclass
- Edited
When calling methods on nodes in the scene you need to put $
in front of their names. Otherwise Godot thinks you're referring to node's classes instead of actual nodes. It's a good idea to change the default name of a node upon its creation to avoid confusion.
So instead of:
Animateion.play("slide")
Partcles.emitting = true
It should be:
$AnimationPlayer.play("slide")
$Particles.emitting = true
xyz i tried what you say but it's changes to this: Attempt to call function 'play' in base 'null instance' on a null instance.
melapelas2048 Let's see the updated code snapshot.
- Edited
That error message means that $Animation is null, i.e. it's not a valid node reference. The scene tree on the left doesn't show the Player or Animation nodes, so it's not clear why that's happening.
If you add this before the line that's causing the error, it will output the current node's children:
print_tree()
melapelas2048 The node name (from your first screenshot) is AnimationPlayer
, not Animation
. So you should've put $AnimationPlayer
there.