I am trying to create an AR application using Qualcomm’s AR sdk.
The following code is used to render the 3d models.
private void OnTrackingFound(){
Renderer[] rendererComponents = GetComponentsInChildren<Renderer>();
// Enable rendering:
foreach (Renderer component in rendererComponents) {
component.enabled = true;
}
Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
}
The hierarchy used is :
ImageTarget (script)
->Gameobject3 (animation)
->Gameobject4 (mesh renderer)
->Gameobject5 (mesh renderer)
However when i add an empty gameobject as in the following hierarchy, the meshes do not render at all. Shouldn’t the GetComponentsInChildren get all componets? How should i change the script to get the desired results?
ImageTarget (script)
->Gameobject2 (empty gameobject)
->Gameobject3 (animation)
->Gameobject4 (mesh renderer)
->Gameobject5 (mesh renderer)