Search Unity

How to detect When OVRAvatar is populated/Loaded?

Discussion in 'VR' started by xtr33me, Apr 2, 2020.

  1. xtr33me

    xtr33me

    Joined:
    Nov 2, 2011
    Posts:
    90
    I am needing to setup tooltips on Oculus Quest controllers. I am currently using the OVR LocalAvatar and have controllers enabled via the checkbox. I have assigned VRTK's ControllerTooltips to each controller but they are not populating for the Quest. So I attached a script to the ControllerTooltip objects and figured I would just get the children of the LocalAvatar object and then based on each name, assign the transforms to the associated "Button Transform Settings". I was doing this in Start, but the localAvatar doesn't have it's children instantiated yet. So I was going to setup a bool and perform a continuous check in the update until my childcount was greater than 0, but this just seems hacky. I was curious if there was a better way of checking for when the localAvatar has instantiated its children, specifically the controller elements so I can go about getting their transforms.

    Any ideas?

    Thanks!