I am experiencing an issue where 3 drones I spawn in just fall through terrain if I place them too low. My origin height is 230, which makes the terrain spawn below 0. I have to place my player start at a height well above the origin so they don’t fall through the terrain into the void. It seems like it takes some time for the terrain to load. I don’t want to have to wait for my drones to fall onto the terrain, and would like them to just start at ground level. Is there something I’m missing or not understanding? Thanks so much.
“Height” in Cesium for Unreal is used with respect to the WGS84 ellipsoid model. The height of a point above the ellipsoid will not always align with its height above the actual terrain.
The best way to prevent objects from falling through is to place static geometry below them, like cubes that are hidden in-game. This is what we do for our third-person controller in the Cesium for Unreal Samples.
There are also other options that are less manual, but they depend on the terrain to load:
You can use Get Load Progress on the Cesium3DTileset to ensure it is fully loaded before you spawn or place any drones.
You can use Sample Height Most Detailed to query the height of the terrain at any given longitude + latitude position. The “height” of the terrain is still relative to the WGS84 ellipsoid, but the point will fall exactly on the terrain’s surface, allowing you to place objects exactly on the ground. This function requires iterating through the tileset’s levels of detail, but it is an async function that you can run in the background.
Let us know if you have any follow-up questions. I hope this helps!
I am kinda facing the same issue, and i believe this can never be the ultimate solution. Imagine having a terrain tileset of an intense topographic area where the terrain fluctuates alot, somewhere it is average and then turns steepy; what should i set in height paramter for an invisible object (cube/rectangle etc) in that case.
Also, i am facing the same issue with my 3d buildings tilesets served via url, i cant find any defined guideline for 3d building tilesets to block vehicles//charcter entering into the buildings.
It’s true that this is a manual solution that may not scale well to multiple objects. One alternative solution is to disable physics on all your objects, then query Get Load Progress on the Cesium3DTileset until it is 100%. After it completes, you can re-enable physics on those objects.