Esempio n. 1
0
    private void MovePlayer()
    {
        Vector2 velocity = VRInput.GetAxis2D(moveInput); //velocity input
        //Vector3 delta = new Vector3(heading.x * velocity.x, 0, heading.z * velocity.y);
        Vector3 deltaForward = playerHead.forward.WithValues(y: 0) * velocity.y;
        Vector3 deltaRight   = playerHead.right.WithValues(y: 0) * velocity.x;
        Vector3 delta        = deltaRight + deltaForward;
        Vector3 newPos       = transform.position + delta * speed * Time.deltaTime;

        transform.position = newPos;
    }
Esempio n. 2
0
 private void Update()
 {
     Vector2 velocity = VRInput.GetAxis2D(moveInput);
 }