# Can't seem to translate in Y using “Jump” axis

I'm trying to write a character controller for a free-moving camera. I don't want it influenced by physics at all (no gravity, no collisions, no inertia). I've managed to get great movement in the X and Z axes with an Input.GetAxis call, but I'm at a bit of a loss for how to move the camera in the Y direction. I figured I should be able to use the Jump axis, but it isn't responding. Here's what I've got in my character controller update function:

float walk = Input.GetAxis("Vertical") * speed;
float strafe = Input.GetAxis("Horizontal") * speed;
float jump = Input.GetAxis("Jump") * speed;
walk *= Time.deltaTime;
strafe *= Time.deltaTime;
jump *= Time.deltaTime;

transform.Translate(strafe, jump, walk);


This seems simple enough to me, but the Jump button (space) does nothing. Also, possibly related, possibly tangential: when I go into the InputManager, it won't let me change the keys set for controlling the Jump axis. I can manipulate the values for gravity and sensitivity, but when I change what keys control the Jump axis, it just defaults back to space for positive and blank for negative once I click away from the box.

• "I figured I should be able to use the Jump axis" and yet your code read the "Horizontal" axis for computing Jump. That seems odd to me; is that a typo? – user1430 Oct 19 '16 at 17:08
• Yeah, that was a typo in the post, not the code. Sorry, should've just copied and pasted it. – ffollett Oct 19 '16 at 17:41
• What values do you get for 'jump' when you press Space? Are they the same as when you aren't (so the axis isn't returning input)? Are they exceedingly smaller than you think they should be? – user1430 Oct 19 '16 at 17:45
• Ok, that's really embarrassing. Adding the line to print to the console made me realize I hadn't saved the script after adding the code for Y axis movement. It works just fine, other than the fact that the InputManager won't accept key values like 'LeftControl' and 'LeftShift'. I can change the keys to letters or numbers or 'space', but shift and control don't seem to be allowed? Am I using the wrong key codes for them? – ffollett Oct 19 '16 at 18:04
• I don't actually use Unity so I can't say. Hopefully somebody else would have some idea. – user1430 Oct 19 '16 at 18:06

Input.GetButtonDown("Jump")