Hello everyone,
I’m building an open world app where the player can choose a location on a big database of airports.
When I load the map the player falls. I created an almost working solution using LineTrace, but it doesn’t work all the time.
What I would like to have is a function (blueprint node or C++ function) or an event that indicates me the height, that way I can move the player to the correct location. Of course I can wait for some second by displaying a loading screen.
Best,
Yannick.
Hi @demonixis,
There’s no really simple solution for this right now. I think I’d attempt to do it like this:
- Put a camera at the correct longitude and latitude, with a height guaranteed to be above the terrain surface (e.g. 9000 meters is high enough even if the airport is at the top of Mount Everest). You can use functions on CesiumCameraManager to place a virtual camera used only for tile selection, rather than a real one.
- Wait until all tiles finish loading. There’s a progress event on the tileset for this.
- Line trace from the camera to the surface.
- Move the virtual camera closer to the surface (but not quite on it).
- Repeat 1-4 until the height returned by the line trace stops changing.
Kevin
1 Like