- Home /
Detecting and setting active a child object using VRTK
So below is my code. There is a top level parent object that acts as the initial target that the controller interacts with, as a child is a runtime generated canvas game object that has the VRTK_Interactable_Object and the VRTK_ChildOfControllerOnGrab script attached to it. The controllers have the Interact touch, interact grab, and controller events scripts on them. I am unable to detect the collider of the top level objects(target) making it impossible to find the hidden child (info). I know I'm doing something wrong its just not apparent to me.
private void OnTriggerEnter(Collider collider) { target = collider.gameObject; Debug.Log(target.name); if (target.layer == 10) { info = target.transform.Find("InfoCanvas").gameObject; info.transform.position = target.transform.position; info.SetActive(true); } grabbingController.GetComponent().ForceTouch(info); if (grabbingController.GetComponent().IsGrabButtonPressed()) { grabbingController.AttemptGrab(); } }