I’m building a VPS project in 8th Wall Studio.
The 3D model appears when the VPS location is found, but it disappears when I move the camera and walk toward it.
From what I understand, this might be caused by the “Target Lost” event hiding the model. My idea is to:
Keep the model visible at all times
Do nothing when “Target Lost” is triggered
Optionally re-align on “Target Found” again
Questions:
Is this the correct approach to make sure the model always stays visible?
Are there built-in settings or best practices for handling “Target Lost” without hiding content?
You’re correct — by default, VPS locations will show their children when tracked and hide them when tracking is lost. To override this, you’ll need a custom component. Here’s a starting point:
world.events.addListener(world.events.globalId, 'reality.locationfound', (e: any) => {
const {name, position, rotation} = e.data
if (name === component.schema.locationName) {
// if location is found, remove the entity and its children
ecs.Hidden.remove(world, component.eid)
// update the position and rotation each found event
ecs.Position.set(world, component.eid, position)
ecs.Quaternion.set(world, component.eid, rotation)
}
})
The key is to move your AR content outside of the VPS location in the hierarchy (so it’s not a child of the location entity) and attach this custom component to a new empty parent entity.