- Home /
Question by
gamezdragon · May 05, 2013 at 07:45 PM ·
buttonjumpgroundair
Button wont work when character is on ground
Hello. I have checked everywhere for this answer, and I haven't seemed to find a solution for my problem.
This is my code:
function Start () {
}
function Update () {
if (Input.GetButton("Fire1")){
animation.CrossFade("Hit");
}
else if (Input.GetButton("Fire2")){
animation.CrossFade("Kick");
}
else
animation.CrossFade("Rest");
}
Whenever I click the Fire2 or Fire1 buttons, aka 'p' or 'r' keys, I get no reaction from the character when it is on the ground. HOWEVER, when my character is falling, or when it is in the air, the actions work perfectly.
Does someone have an answer to this problem?
Thanks.
Comment
Your answer
Follow this Question
Related Questions
how can i make the jump responsive? 2 Answers
In Air Movement 0 Answers
Jumping when not grounded 2 Answers
Can Someone Help me with my Onclick Jump Button to only fire only if Grounded 1 Answer