Download

UE4.22 - How to "GetRandomPointInNavigableRadius" but always forward?

Hi, while AI is under attack i want it to change location by using “AI Move To” node and “GetRandomPointInNavigableRadius” inside a BP, but istead of finding this location in an spherical “radius”, find it only in a 90° forward radius or a cone radius.

why? because while under attack, if i use a normal value as radius, AI can also find locations behind, and start running away to locations behind wich makes it give his back to players and make it an easy target, for this reason i want it to only find random locations in front.

randompoint.png

Please Help with BP pics if possible!

https://docs.unrealengine.com/en-US/…Box/index.html

You should be able to combine the radius and the box may e by getting a random point to start the origin of the radius and making the radius a smaller size.

Could you please show me how, because i think the box extent is going to create a box área around, not in front.

The nodes creates the box or the sphere wherever you tell it to.
just get your forward vector and add an arbitrary number of units to it so that the center point is in front of the character.

you can also just do the same with the current radius.
Simply multiply the forward vector by the radius and the circle you are looking for will be offset right in front of you. By a radius, so the edge will be in front of you.

The origin in both cases is just a vector3, so all you have to do is figure out where that supposed to start for it to be in front.

the reason for the box extent would be to cut off results outside the range and therefore make an actual cone.

Another solution could be to use a scaled cone volume and make sure the chosen point is within the cone’s bounds. I think this process is too lengthy for an AI to make a decision though. It’s best to keep stuff super simple - further origin, smaller radius.