- Home /
What is the "jump"/ Y axis? How It's called in scripting?
Hey, I'm a bit new in Unity and i really need help with something. I'm creating a simple game and i want to play an animation while I'm in air. It worked with Walking
if(Input.GetAxis("Vertical"))
{
animation["Run"].wrapMode = WrapMode.Loop;
AnimPlayer.animation.CrossFade("Run", 0.4);
}
else
{
animation["Idle"].wrapMode = WrapMode.Loop;
AnimPlayer.animation.CrossFade("Idle", 0.4);
}
^ That worked perfectly, but i need to know what Axis is for Y :(
I only found someone said about if(Input.GetAxis("Jump")) but that doesn't work :< Sorry for my bad english!
Answer by Em3rgency · Jul 01, 2013 at 03:35 PM
Well you need to define what controller/button is what axis. Or you could just hardcode in the buttons.
if(Input.GetKey(KeyCode.Space))
Your answer
Follow this Question
Related Questions
Velocity and Animator change while game is Paused 1 Answer
How do I get my jump animation to work? 1 Answer
Character changing its orientation randomly while calling the animation through scripting 0 Answers
Minor Addition to Jumping using CharaterController 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers