My problem is that my character is not going in the direction hes facing; I attached some images, the arrows on the one to the left is what he is doing, the one on the right is what I need.
I also posted my code, the part with the problem, below
private var x = 0.0;
private var y = 0.0;
private var z = 0.0;
private var controller = GetComponent(CharacterController);
x = Input.GetAxis("Horizontal") * 15 * Time.deltaTime;
y = Input.GetAxis("Vertical") * 15 * Time.deltaTime;
if(!controller.isGrounded)
{
z = -20;
}
else
{
z = 0;
}
controller.Move(Vector3(-x*1,z*Time.deltaTime,-y*1));