void FixedUpdate() { var body = GetComponent <Rigidbody>(); body.velocity = new Vector3(Input.GetAxis("Horizontal") * speed, 0.0f, Input.GetAxis("Vertical") * speed); body.position = boundary.Apply(body.position); body.rotation = Quaternion.Euler(0.0f, 0.0f, body.velocity.x * -tilt); }