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!
Solved! Go to Solution.
One method you could consider is to check colliders using raycast.
One method you could consider is to check colliders using raycast.
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!