Based on the ArcGIS Maps SDK for Unreal Engine v2.2.0 plugin running on Unreal Engine 5.5.
I need to implement a procedural random foliage spawning feature, with the technical workflow broken down into the following steps:
1.Utilize the raycast function provided by the SDK to retrieve ground position data at the mouse click point.
2.Take the clicked ground coordinate as the center point, then generate multiple randomized offset coordinates; the total spawn count is adjustable via exposed parameters.
3.Spawn clones of the designated blueprint asset, each equipped with a ArcGISlocation component.
4.Assign the procedurally generated coordinate values to the ArcGISlocation component of each cloned actor, and set Surface Placement Mode to On the Ground.
5.Serialize and save the location data of all spawned foliage clones to a local JSON file.
6.On subsequent application launches, deserialize the JSON data and respawn the corresponding foliage assets.
Issue Description
During real-time runtime spawning, the cloned foliage actors fail to consistently snap to the ground — some sit on the terrain surface while others spawn underground. I suspect there is an issue with the calculation logic of the On the Ground property described in Step 4, and its ground alignment effect does not take immediate effect.Generate Grass
This is because after closing and restarting the program, when initializing foliage clones by loading the saved JSON coordinates, the ground snapping function of the location component works properly as expected.
Initialize Grass
I confirm every actor has an ArcGISLocation component.
Grass Blueprint
What is the root cause of this inconsistency?