Very basic question here: how do I code up and down movement along the y axis? Unity seems to have inputs set up for x and z but not y. This is my code so far. All it does is allow x and z movement and has the camera orient along one axis.
function Update ()
{
//x, y movement
var Controller : CharacterController = GetComponent(CharacterController);
var vertical : Vector3 = transform.TransformDirection(Vector3.forward);
var horizontal : Vector3 = transform.TransformDirection(Vector3.right);
if(Input.GetAxis("Vertical") || Input.GetAxis("Horizontal"))
{
Controller.Move((vertical*(forwardSpeed*Input.GetAxis("Vertical")))*Time.deltaTime);
Controller.Move((horizontal*(horizSpeed*Input.GetAxis("Horizontal")))*Time.deltaTime);
}
//camera movement on x axis
if(Input.GetAxis("Mouse X"))
{
yRot += 10*Input.GetAxis("Mouse X");
}
transform.rotation = Quaternion.Euler(0, yRot, 0);