Thanks for the answer. I forgot to mention one important detail.
I discovered that targetedToAnyEntity() doesnt work in my case because I'm creating an instance of the PerspectiveCamera
func createCamera() -> Entity {
let camera = PerspectiveCamera()
camera.name = "Camera"
camera.look(at: [160, 80, 1], from: [160, 80, 200], relativeTo: nil)
return camera
}
and in this case RealityKit disables automatic input routing, because now I'm responsible for defining how the world is rendered and interacted with.
RealityView { content in
content.add(createCamera())
However I need that camera :(
Automatic input routing also stops to work if entity is to far from the default camera :(
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: