I have a Google Cardboard object, with this script attached to the Head object and a Rigidbody componet:
public class PlayerMovement : MonoBehaviour {
public float thrust = 2.0f;
void FixedUpdate()
{
transform.Translate(Camera.main.transform.forward * thrust * Time.deltaTime );
}
}
I’d like to constantly be moving in the direction I am looking. But using this script when I change my gaze direction my movement doesn’t always follow.
Sometimes it works perfectly, and other times the movement is completely off depending on the build of the game.
Seems like a simple script, but maybe I’m not doing something correctly???