I’m using the Environment Query system. In the enclosed picture, I have donut points with trace and dot tests.
The guard AI runs to the point to basically run from the player, when he’s armed.
I want the guard to strafe the player and maybe look for cover but still keep the player in sight.
Do anyone have any idea on how to do that?
Any help would be greatly appreciated.
PERSONALLY, I wouldn’t use EQS for this.
I would create a custom Task node called “circle strafe” and I would just have it call blueprint logic which, every tick, updates the AI’s control rotation to face the player and then applies a movement input to the left of his current control rotation. This is how players circle-strafe (move left while rotating the aim).
If you set this up as a task you can use the EQS donut trace for things like determining if there’s sufficient space around the player to execute the maneuver without getting stuck on a wall or falling into a pit, and use a blackboard key that queries distance to player to halt the execution of the action if the player moves too far away from the enemy, but I wouldn’t try to use move targets for this. If nothing else, even if you could get the logic in place using the EQS Queries, the AI’s motion would be fairly lurchy as he moved from one spot to the next, rather than a smooth circle strafe motion.
Thanks for the tip. I’ve been trying to understand AI strafing for years, but never got it.
I will do that for strafing, but I also wanted the AI to pick some cover if under fire.
I’ve been trying to use the method you mentioned, but the built in move to functions force the pawn to look it the direction, even with strafing checked.
Will look into other solutions.
don’t use MoveTo, use an action which literally just applies leftward movement on the pawn. MoveTo is a navigation command which does more than just move (it moves using navmesh paths, rotates the pawn to face the move target, etc).