I want to play the melee animation when I click the left mouse button, but for some reason, I can’t play the animation after I click. Here is my code:
public class AnimationController : MonoBehaviour
public Animator anim;
anim = GetComponent<Animator>();
Scripts look good to me. Please check below two points:
- Did you assign the correct animator controller in the Animator(In Inspector) which should be added to the game object?
- In the Animator window did you added the correct animation clip(“melee” or “Melee” the name should be same ) which you wanted to play?
If nothing from above helps could you please mention the exact Error or Warning which you are getting.
screen shot of animator window while in play mode?