ManipulationComponent + Warning messages in RealityView

Hi guys! I wanted to study this new ManipulationComponent(), but I keep getting a warning that I don’t understand, even in a very simple scenario. i don't have any collisions just binding the Manipulation

the warning message is :

** Entity returned from EntityWrapper.makeEntity(context:) was already parented to another entity. This is not supported and may lead to unexpected behavior. SwiftUI adds entities to internally-managed entity hierarchies.**

        RealityView { content, attachments in
            

            if let loadedModel = try? await Entity(named: "cloud_glb", in: realityKitContentBundle) {
                
                content.add(loadedModel)
                loadedModel.components.set(ManipulationComponent())
                
            }

Thanks !

Oh, so that's causing it. Since yesterday I'm trying to figure out what I messed up for this error to show up and can't find anything. Removing the call to ManipulationComponent.configureEntity made it go away :).

In general it seems to be working for me - if you do ManipulationComponent.configureEntity(someEntity) it makes all the basic things you need (otherwise my understanding is that you need to add all the required components, like collision). Then you can do, for example, someEntity.components[ManipulationComponent.self].releaseBehavior = .stay (configureEntity apparently automatically adds also that component, which I discovered 5 minutes ago, because earlier I was creating and adding my own). But yes - the error is always there when it's called...

Hi @brother_z ,

Don't worry too much about this, this is a known log spam that occurs with ManipulationComponent but should not be related to any actual failures in your app. Are you seeing anything go wrong? It seems like it's working as per your last response! If it continues working, feel free to ignore this and file a feedback report about it at https://feedbackassistant.apple.com to ask about removing it!

Yes, once I found out that this component is causing that error (thanks to @Draiis post here) I realized that it was some other place where I messed up some relative offsets that were pushing the entities far away from me. But when I was debugging it, the first thing I noticed was that error, which sent me on a wild goose chase, because I assumed I'm doing something wrong that makes things not appear, because they "already are parented" and it can cause "unexpected behavior" :).

Submitted FB20176878.

ManipulationComponent + Warning messages in RealityView
 
 
Q