![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | tailgunner90 |
I have a very simple problem trying to change the animation based on a button I press.
Within my Node2d (SoldierRig) I have a few animations set on the AnimationPlayer. upon trying to simply change animations using the following command
func _on_TakeCoverButton_button_down():
$SoldierRig/AnimationPlayer.play = "Prone"
I expected the animation to change from “Running” to “Prone” but instead the game crashes and I get the error “Invalid set index ‘play’ (on base: ‘AnimationPlayer’) with value of type ‘String’.” Could someone please show me what’s wrong with my syntax?