Getting Child ModelEntity from Reality Composer Pro

Hi,

I have a file in Reality Composer Pro that has a deep hierarchy. I've downloaded it from an asset store so I don't know how it is build.

As you can see from the screenshot, I'm trying to access banana and banana_whole entities as ModelEntity but I'm not able to load them as ModelEntity in Xcode.

I can load them as Entity and show them in visionOS Simulator but not as ModelEntity which I need to do to do some operations.

What should I do?

Replies

I believe you can cast "banana_whole_m_banana_outer_0" as a ModelEntity. A ModelEntity must have a valid model-component, and looking at that hierarchy from "banana" down, only "banana_whole_m_banana_outer_0" has a mesh.

Add a Comment

Were you able to figure this out?