Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

HOW CAN I MAKE THIS WORK ONLY ON MY RIGHT HAND??????? PLEASE HELPPPPPPPPP!!!!!

Discussion in 'AR/VR (XR) Discussion' started by Mikeramczyk1977, Sep 18, 2020.

  1. Mikeramczyk1977

    Mikeramczyk1977

    Joined:
    Jul 12, 2020
    Posts:
    58
    HOW CAN I MAKE THIS WORK ONLY ON MY RIGHT HAND??????? PLEASE HELPPPPPPPPP!!!!!

    Code (CSharp):
    1.  
    2.  
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using UnityEngine;
    6. using UnityEngine.XR;
    7. using UnityEngine.XR.Interaction.Toolkit;
    8.  
    9. public class ContinuousMovement2 : MonoBehaviour
    10. {
    11.    
    12.     public float speed = 1;
    13.     public XRNode inputSource;
    14.     public float  RotateSpeed = 5;
    15.     private XRRig rig;
    16.     private Vector2 inputAxis;
    17.     private CharacterController character;
    18.    
    19.  
    20.     // Start is called before the first frame update
    21.     void Start()
    22.     {
    23.         character = GetComponent<CharacterController>();
    24.         rig = GetComponent<XRRig>();
    25.     }
    26.  
    27.     void Update()
    28.     {
    29.         InputDevice device = InputDevices.GetDeviceAtXRNode(inputSource);
    30.         device.TryGetFeatureValue(CommonUsages.primary2DAxis, out inputAxis);
    31.  
    32.  
    33.     }
    34.  
    35.     // Update is called once per frame
    36.  
    37.     private void FixedUpdate()
    38.     {
    39.  
    40.         transform.Rotate(0, Input.GetAxisRaw("Horizontal") * RotateSpeed, 0);
    41.  
    42.     }
    43.  
    44. }
    45.  
    46.