+1 vote
func _input(event):
if event.is_action_pressed("my_action"):
    play_anim("Attack")
Godot version 3.2.3
in Engine by (27 points)

Can you show more code? Nothing seems wrong with this.

  1. You might have not assigned the correct mouse button to the input: ("my_action").

  2. It is case sensitive, so anything like Myaction or MyAction won't work.

  3. The 2 points up is also true for the animation name.

  4. I need some more code and the animation for more troubleshooting.

1 Answer

0 votes

Not enough information... could be a number of things...

Do you get errors in the debugger? If so, could you copy/paste them here?

What node is this script attached to? What nodes are in the tree?

There are a lot of tutorials out there for this ... Try a YouTube search for Godot animation tutorials.

by (32 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.