Default RealityViewContent has multiple anchors?

I am developing an app in mixed immersive native app on Vision Pro. In my RealityView, I add my scene by content.add(mainGameScene). Normally the anchored position (original coord) should be the device position but on the ground (with y == 0 on the ground). At least this is how I understand the RealityViewContent works. So if I place something at position (0, 0, -1.0), the object should be in the front of you but on the floor (z axis is pointing backwards)

However recently I load a different scene and I add that with same code, content.add(mainGameScene), something has changed, my scene randomly anchored on the floor or ceiling, according to the places I stand or sit. When I open Visualizations of my anchoring point, I could see that anchor point I am using is on the ceiling. The correct one (around my foots) is left over there.

How could I switch to the correct anchored position? Or does any setting can change the behavior of default RealityViewContent?

Answered by milanowth in 786360022

Turns out it's the matter of 3D model (or at least replacing with new 3D model can fix it). The original model contains a scope type (I don't know what does it mean in Reality Compose Pro). I use this model as .usdz and drag and drop to my scene. But it seems like this "scope" hierarchy has blocked the model to use its parent's anchor. Which I think with literal understanding, "scope" means it is not "controlled" by its parent?

However recently I load a different scene and I add that with same code, content.add(mainGameScene), something has changed, my scene randomly anchored on the floor or ceiling, according to the places I stand or sit.

It sounds like you are loading a scene that was created in Reality Composer Pro. You likely have an Anchoring component somewhere in your scene hierarchy that is set to anchor to any plane. I recommend searching through your scene in Reality Composer Pro and looking for an Anchoring component, and then removing it, since it sounds like the behavior you want is the default anchoring (equivalent to world anchoring at [0,0,0]).

@milanowth

If you don't have an Anchoring component, then most likely the offset from the world origin that you are seeing is baked into the geometry of the model you are adding to your scene.

Accepted Answer

Turns out it's the matter of 3D model (or at least replacing with new 3D model can fix it). The original model contains a scope type (I don't know what does it mean in Reality Compose Pro). I use this model as .usdz and drag and drop to my scene. But it seems like this "scope" hierarchy has blocked the model to use its parent's anchor. Which I think with literal understanding, "scope" means it is not "controlled" by its parent?

Default RealityViewContent has multiple anchors?
 
 
Q