Loading scene created from Reality Composer cannot be reused

I created a scene in Reality Composer which includes lots of different models. Then I load scene and try to load model and place them separately, the following is my UITapGestureHandler:

guard let loadModel = loadedScene.findEntity(named: selectedPlant.selectedModel)
            else{
                return
 } 
loadModel.setPosition(SIMD3(0.0,0.0,0.0), relativeTo: nil)

My confusion is, when you use .findentity and place this model to the detected plane, it cannot be retrieved again: I try to call this again to place a second model after placing the first one, and .findentity returns nil. Does anyone know the mechanism behind it? I thought loading the scene will create a template in memory, but in contrary, it seems like only creating a sort of list and pop out entity for every call.

Replies

Hi, could you file a bug report for this in Feedback Assistant?

  • Hi, so I can understand that you can confirm this is a bug and not design by intended ?

  • I believe it's a bug, yes, but someone will need to investigate to confirm. I looked at the source code, and it doesn't look like findEntity modifies the scene. However, if this is expected behavior, we should make sure it is documented somewhere, so we will want this issue tracked regardless.

Add a Comment