Advertisement
Guest User

Untitled

a guest
May 20th, 2020
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using Oculus.Platform.Samples.VrHoops;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5.  
  6. public class grabtomove : MonoBehaviour
  7. {
  8. public GameObject L_Hand, R_Hand, XRRig;
  9. public Vector3 addedpos, lhandpos;
  10.  
  11. void Start()
  12. {
  13.  
  14. }
  15.  
  16. void Update()
  17. {
  18. OVRInput.Update(); //requirement
  19.  
  20. if (OVRInput.Get(OVRInput.Button.Any))
  21. {
  22. lhandpos = L_Hand.transform.position;
  23. addedpos = XRRig.transform.position + -lhandpos;
  24. XRRig.transform.position = addedpos;
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement