Colliding with Map Geometry
To see an example of collisions against the map:
- Open the scene
- Ensure your API key is set at least on the Collision GameObject’s Wrld Map component
- Click the Play button
- Select “Colliding with Map Geometry” from the dropdown
- Click on the map to fire a projectile into the scene
You can enable collision independently for Terrain, Roads, and Buildings by ticking the checkboxes for them in the Wrld Map inspector, as shown above.
When collision is enabled, the API will generate collision meshes alongside the visual meshes used to draw the map. This will use more memory and add some latency to the streaming of the scene. Because of this, we recommend disabling collision for any types of objects that don’t require it.
We recommend that you start the API with the UnityWorld coordinate system when using collisions. This orients the map so that the direction of gravity points down the negative Y axis for the area around the start location, which allows for more intuitive use of Unity’s physics system.
If you do want to use collision in ECEF, you will need to make sure that Unity’s gravity vector is kept up to date, to point towards the center of the earth.