app, which you can move an Entity having a PerspectiveCamera as its child in immersive space, and render the camera view on 2D window. According to this thread, this seems to can be achieved using RealityRenderer. But when I added the scene entity loaded from realityKitContentBundle to realityRenderer.entities, I needed to clone all entities of the scene, otherwise all entities in the immersive space will disappear. Is this the expected behavior? Or is there any other way to do this (move camera in immersive space and render its output on 2D window)? I really like your use case! Super creative. The behavior you're observing is expected. An entity can only have a single parent. Anytime you add an entity to another entity, it is removed from its parent. In this case, when you add scene to renderer it removes scene from the immersive space's content. Cloning the entity is a reasonable solution. Alternatively you can load 2 copies of your RealityKitContent; one for the immersive view and another for the reality renderer.
// When the scene entity is added to RealityRenderer, it removes scene from the immersive space's content. // So we have to clone the scene entity recursively. renderer.entities.append(scene.clone(recursive: true))
ynagatomo/RealityRendererTest.swift Developer Forums • How to move a camera in immersive space and render its output on 2D window using RealityKit • How to display a RealityKit Perspective Camera View in a visionOS SwiftUI 2D window? note • RealityKitでドローンカメラ 映像をウィンドウにレンダリングしてみた • clusterでドローンを操縦してクリスタルを集めるゲームワールドを作りました Creators Guide • ワールド内に置いたカメラ 映像 投影ができる「 Render Texture(レンダーテクスチャ)」 紹介