12-11-2016 10:06 AM
void FixedUpdate()
{
if (joint == null) //joint is a private FixedJoint
{ GameObject go;
if (OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger))
{ //throwableObject is a public gameobject to track if existing object is grabbed. if not, we create one at hand
go = (throwableObject == null) ?
GameObject.Instantiate(Persistent.instance.gameManager.objPrefab) : throwableObject;
go.transform.position = leftHand.transform.position; //leftHand is hand_left from LocalAvatar. used in script as a public GameObject
go.GetComponent<ObjManager>().IsGrabbed(); //turns off gravity on obj, sounds, etc
joint = go.AddComponent<FixedJoint>();
joint.connectedBody = leftHand.GetComponent<Rigidbody>(); //added rigidbody without gravity and a boxcollider trigger to the left_hand from LocalAvatar
}
...
Solved! Go to Solution.
12-11-2016 10:36 AM
12-11-2016 10:36 AM
12-11-2016 06:08 PM
12-12-2016 07:40 PM
12-13-2016 07:58 AM
12-13-2016 10:24 AM
12-13-2016 01:32 PM