private void OnCollisionStay(Collision collision) { if (collision.collider.tag == "Moveable" && pressing)//OVRInput.Get(OVRInput.Button.One)) { if (!trigger) { Rigidbody body = collision.collider.GetComponent <Rigidbody>(); if (body != null) { body.isKinematic = true; } interactChild = collision.collider.transform; if (interactChild.parent.GetComponent <HandInteract>() == null) { originalParent = interactChild.parent; } trigger = true; } } else if (collision.collider.tag == "Interactible" && pressing)//OVRInput.Get(OVRInput.Button.One)) { if (!trigger) { Interactible inter = collision.collider.GetComponent <Interactible>(); inter.Action(gameObject); trigger = true; } } }
// Send command to the server to do the interactible object action void CmdAction() { actionableObject.Action(); }