- Home /
Problem with "attack" animation
Hi, This is a newbie who has just started learning unity. So please bare with me on this question. I am basically trying to develop a 3d person game. I loaded the Spartan King 3D model, attached the character controller component and third person controller script (included in the default assets)for the Spartan king. This does the basic movements well.. he walks .. runs..
The PROBLEM : I wanted to add a extra animation to it. When the player clicks left mouse button, the attack animation has to be played. SO i went in to the update code (in third person controller) and added the following to the previous set of function calls :
if(Input.GetMouseButtonUp(0)) { animation.Play("attack"); }
Now my animation looks glitchy, Like when i click the button.. for that fraction of a second it starts to animate attack.. but after its clicked it goes back to the idle position.
I think that in some other part of the code it sets a default animation like idle to be played when there is no input form the user.Maybe that is why it goes back to idle one the input click is over. Please correct me if i am wrong. I wanted it to complete the animation , then get back to idle.
I would be very grateful if someone could help me on this. Thank You.
Your answer

Follow this Question
Related Questions
Character lung forward for attack? 1 Answer
Crossfade Quickening 0 Answers
Player Attacking Enemy Issue 0 Answers
3rd person character attack wont play sound??HELP! 2 Answers
Player attack script + enemy health 1 Answer