Rotation resets on character controller
There's probably a really simple solution to this small but neat script which makes a cube run around. Right now the rotation goes back to zero after the cube stops moving. I'm not sure why.
Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical"));
transform.rotation = Quaternion.LookRotation(movement);
transform.Translate(movement * speed * Time.deltaTime, Space.World);
Comment