Hello! I’m working on AI agents in Unreal Engine and need help with setting up their movement around a lake. My goal is for the agents to roam freely around the lake by moving to random points, pausing (idling), and then repeating this behavior.
I know I can use GetRandomReachablePointInRadius with the agent as the origin and a small radius for random movement, but I want to refine this behavior based on their distance from the lake. Specifically:
Inner Circle (Closest to the lake): The movement should be entirely random.
Middle Circle: The agents should be more likely to move towards the lake, but with some randomness.
Outer Circle (Furthest from the lake): The movement should strongly favor returning towards the lake, it should be 100% towards the lake if you’re at the extreme end, making it impossible for agents to move outside the largest/red circle.
The idea is to have most of the agents stay within the first circle around the lake. Additionally, if an agent gets too close to the lake, their movement should be biased away from it to prevent them from clustering right at the water’s edge.
The easiest way I can think of to get you want you want is to use doughnut-shaped planes with overlapping collisions and events that keep track of actor locations:
If you do not already have the Modeling Mode installed, check plug-ins
Hello,
Thank you for your response! However, I think there might be a slight misunderstanding about my issue. I can already determine the agent’s position relative to the lake by measuring the distance between them, so there’s no need to use meshes for that.
What I’m trying to achieve is to have the agents move differently in specific zones around the lake:
Inner Circle: When the agent is within the inner circle, I want them to move randomly using the “GetRandomReachablePointInRadius” function.
Middle Circle: If the agent is in the middle circle, I also want to use “GetRandomReachablePointInRadius,” but with a slight bias towards the lake, ensuring that the new location is still reachable.
Outer Circle: For agents in the outer circle, the same function should be used, but with a stronger bias towards the lake, again ensuring that the chosen point is reachable.
This should result in most agents being near the lake, with fewer in the middle circle, and only a rare few in the outer circle.