08-31-2019 12:05 AM
public Transform leftController;
public Transform RightController;
public Transform camera;
// Start is called before the first frame update
void Start()
{
camera = gameObject.GetComponent<Transform>(); // i
OVRManager.display.RecenterPose(); // made this as a meaning to fix the world center problem - didn't work
}
// Update is called once per frame
void Update()
{
leftController.SetParent(camera); // i thought maybe the controller loses it parent on launch - didn't work
RightController.SetParent(camera); // i thought maybe the controller loses it parent on launch - didn't work
OVRInput.Update();
leftController.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.LTouch);
leftController.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.LTouch);
RightController.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);
RightController.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);
}