- Home /
what is the jump axis for if (Input.GetAxis(" ? ")
which axis do i use to play my "jump animation" if i wanted to use this line of script ?
if (Input.GetAxis(" ? ") > 0) animation.Play ("jump");
Answer by Berenger · Jun 09, 2012 at 09:05 PM
Whichever you want sounds like a good answer. You may have seen Input.GetAxis("jump") ins some tutorial, hence the confusion. GetAxis take a string depending on the Input Manager. By default, Unity defines a "jump" for the space bar, because it's often what you want, but feel free to either modify "jump" in the IM, or create your own.
Answer by Player_1 · Jun 09, 2012 at 09:40 PM
well all the GetAxis is i detecting the key press so you need something like
void Jump()
{ if(Input.GetAxis("Space") > 0) { animation.Play("walk"); rigidbody.AddForce(Vector3.up *JumpSpeed); }
} try seting your jump speed to something depending on the scale of your game
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
jump animation doesn't play all the way if i am moving 1 Answer
Character won't play animation 8 Answers
Jump Script 0 Answers
issues with animation :( 1 Answer