Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  3. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  4. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  5. Read here for Unity's latest plans on OpenXR.
    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:
    47
    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.  
     
unityunity