Mouse Click Plays an Animation
I am trying to play an animation on every mouse click . I dont want it to keep looping after the first click . How would I go about it . I have tried a script and it didnt work . I attached it to model that would be doing the animation but still no luck . Renamed the animation so there are no duplicate names and still no success . Anybody got a full script I could try and Use >>?
Answer by Anhella · Aug 24, 2020 at 06:46 PM
good day try this script it works. add your animation to the animator and open C# pase this in update. void Update() if()Input.GetMouseButtonDown(0)) { anim.Play("Dead", -1, 0f); }
hope this work
Your answer
Follow this Question
Related Questions
Can i use animation timeline like slider value to get access using for ex. mouse Y value. 1 Answer
Depending on the mouse movement (or position), the player sprite 0 Answers
If Mouse cursor is above an object, start animation (without click on It) 2 Answers
How to trigger turning animation on moving the mouse? 0 Answers