Select to view content in your preferred language

ArcGIS Unity Mesh Colliders

718
2
09-28-2022 08:12 AM
ChristofferLindellBolin
Occasional Contributor

Hi, I am currently having a few issues with the generated ArcGIS mesh colliders.  I have a few gameobjects in my scene with rigidbody enabled and gravitational force acted upon them. There are a number of issues that I have found while experimenting with this.

To begin with, on startup the gameobjects will fall straight through the map since the tilles has not loaded in yet. I have tried to solve this issue by implementing a wait function. See below, where after the ArcGIS map is created I call this coroutine. This does not solve it though, since the ArcGISLoadStatus is changed to loaded almost immediatly while all of the visible tiles are still loading in. Is there anyway to wait until a certain amount of tiles have been rendered? Or do you have to for example wait for a hardcoded time X seconds until the tiles have loaded? (I have tried this and it worked okay ish, but it does not seem optimal)

ChristofferLindellBolin_0-1664376805260.png

Another Issue I found is when you unload the tiles, with it also mesh colliders are unloaded so the gameobjects will fall through the map. How would one go about solving this issue? Should you have "pre-baked" mesh colliders for the entire world (will most likely have a heavy impact on performance)? Or shall one disable the physics when the objects are not visible?


Thankful for any advice or help!

 

Tags (2)
0 Kudos
2 Replies
Matt_Nelson
Esri Alum

So the LoadStatus is not related to the rendering status of the layer. The load status just means we have processed the meta data successfully and started to render it.

You can use a raycasat to determine if content is still loaded underneath a GO. You could use this to determine if the tiles are initially loaded or if they are unloaded.

This is good feedback and we will look into how we can make this UX better.

ChristofferLindellBolin
Occasional Contributor

Hi again, I have been trying this approach with minimal success by raycasting in the direction of the gravitational force. The main issue is in regards to when the tiles changes LOD, also the mesh colliders change. Which causes the gameobjects to sort of glitch through the map. Also, on startup I get hits on the mesh colliders and still falls through the colliders, this may have also to do with the LOD. I could solve this issue by placing the objects high enough, which gives the tiles enough time to fully load in.I think it would have been useful if you were able to determine the tiles LOD based on either the layer or tag.

Gameobject configurationGameobject configurationGravity and raycast implementationGravity and raycast implementation

 

0 Kudos