Select to view content in your preferred language

Wait for World_Imagery Layer Load

639
2
Jump to solution
01-23-2023 08:34 AM
BenSBaker
New Contributor

Hello, 

I'm currently attempting to create a first-person simulation of a city, where one can walk around. However, I'm having trouble with the world_imagery layer mesh colliders loading. The player is falling below the world, due to the colliders not being available immediately.

 

My current solution is to wait for a fixed amount of time and hope they are loaded, then spawn the player in. However, I'm hoping for a more deterministic system using an event. I've looked into the ViewStateChanged event and LoadStatusChanged event. Both reach active or loaded before there is a mesh available. Is there another component I could use or a different approach I should try?

 

Thank you for your time!

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Jade
by Esri Contributor
Esri Contributor

One method you could consider is to check colliders using raycast. 

View solution in original post

2 Replies
Jade
by Esri Contributor
Esri Contributor

One method you could consider is to check colliders using raycast. 

BenSBaker
New Contributor

Based on your suggestion, I implemented a Coroutine that waits until the Physics Raycast returns true. The player is initially higher than the ground, and using a small max ray cast distance prevents it from being triggered from the initial load of the layer.

 

Thank you for the help!