Get Random Reachable Point is under landscape sometimes

Hello all, this is my first post here.

Yesterday I tried for hours to solve a issue I have with a Spawn Actor from Class with “dont spawn if colliding” settings. I have Landscape with some hills and mountains and I spawn the Actor arround the player with Get Random Reachable Point in Radius - the Radius is 3000. Sometimes the Actor gets spawned under the landscape near the player if the player stands near a small hill/ramp and than fall off the map till it gets destroyed. Have someone an idea why this happends ? Under the landscape there is no navmesh so it should be not a “reachable random point”. When I draw debug points to make the “reachable random points” visible I can see that there a huge amount of points under the landscape but always just where a player needs to go up a small hill. On parts where the landscape is flat everythings works fine. I need to say too, that the actor spawns also correctly on the hill but sometimes under the hill.

Iam not at home at the moment so I made a cool paint picture :smiley:
(Black: Player and landscape. Red the wrong spawn points under a hill, Green: navmesh
paint example
)

Did you rebuild navigation?

I guess yes. When I place an object or move somehting arround the navmesh gets rebuild. Also created a new NavMeshVolume. Everthing seems to work normally but sometimes the generated “Random reachable point” is under the landscape and under the navmesh.

Hey there @Daedrafaction! Welcome back to the community! Usually if there’s no other meshes or collisions that could be generating walkable terrain (according to navmesh) under the terrain. Are you only using it for spawning? If so a workaround could be to test the point with a vertical trace real quick and use the location where a hit on landscape is as the true spawn locale. I’ve had to retrofit a system like that on to a project before but it’s not the best workaround.

2 Likes

Thank you for the reply! Theoretical this sounds great! I will test this later with a vertical trace and hopefully I can rescue my actor from falling into the endless void :slight_smile:

1 Like

Absolutely, let me know if this workaround is infeasible and we can try to find a better alternative.