|
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");
(comments are locked)
|
|
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. thanks, GetAxis("Jump") works.
Jun 09 '12 at 09:42 PM
thedumbone74
(comments are locked)
|
|
well all the GetAxis is i detecting the key press so you need something like { 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
(comments are locked)
|
