Hello UE4 Community,
Is there any way to check if a straight path from one actor to another is free? I would use the “Pathfinding Context” input for “Find Path to Actor Synchronously”, but there doesn’t seem to be any documentation about what exactly I should plug into it.
Context
The AI logic supposed to go like this:
- Go toward the target actor (the player in most cases)
- While moving, check if a straight path to the target is clear
- If it is, stop moving
- Pause for a “windup”
- Dash toward the target (travel along the ground a certain distance over time)
- Pause for a “cooldown”
- Repeat
The problem comes in when I want to check for collisions along this path. When using a capsule trace, it only goes in a straight line, so any time the player and enemy are on a different elevation, the collision check will not be accurate. I’d much rather use the navigation system to my advantage by simply checking if I can move in a straight line on that path without running into any collisions, but I haven’t found a way to do this.
NOTE: Even though I placed this in the Blueprint Scripting Section, I am willing to try a C++ solution. While I am by no means an expert with C++, I do have a decent amount of coding knowledge.
Thank you,
Quiteblank