Moving Up and Down in Y Space

Im trying to make my object go up and down in Y space upon key stroke. Im using the GetAxis(“Horizontal”) and (“Vertical”) to go left/right back/forth. How can I do this?

Sorry I meant Y space. Basically…it already is moving around in X and Z space. I want it to be able to go up and down through keystroke.

If you are using input.GetAxis("Vertical"), it will be automatically mapped to the arrow keys.

if use like this:

 var speed : float = 5.0;
 var someObject : CharacterController;

 function Update()
{
   var translation : float = Input.GetAxis ("Vertical") * speed;
   translation *= Time.deltaTime;
   transform.Translate (0, translation, 0);
}

There are two actions going to happen when you press the “up” arrow key. I don’t think this will meet your problem.

But this surely make you think. Good luck.

You want to use MyCharacter.Move(moveDirection * Time.deltaTime);