Bit of a conundrum here. I’m almost at the technical completion level of my 2D action platformer prototype - only two enemies in the initial stage of development (not including the mission boss) and one of them is a swordfighter. What I want to have this particular enemy do (the separate definition of a gunner don’t necessarily need this) is to approach on foot, and if he or she gets close enough to strike, then the player’s avatar gets slashed in the face. As of now, only the latter of the two phases of this behavior is implemented in the starter blueprint that I’m using, so I essentially need to add some nodes for the patrol maneuvers.
Any advice?
EDIT: I should note that by patrol, I specifically mean that the attack attempt is a proximity response based on how close you are to the enemy.
Are you using AI behaviour trees? If not google AI Behavior tree or start with this.
I think that is more simple to use, however if you want to do it manually couple of things should be done.
- AI MoveTo Target Location, while moving
- Checker Function : Is Target In Range ( can be min - max)
- If True: Do Slash, if not keep moving.
Do correct if its wrong answer, explain step by step what needs to happen.
If you want to do blueprint logic a simple one is below just for demo reasons. AI behaviour trees and task branching is the right way of staying organised.
Thanks to both of you - it’s done and done.
What I did was to set up the “move to player” with an acceptance radius of 80, stopping on overlap and without using pathfinding. After that, it’s just a matter of inputting the target and destination references into their respective inputs and BAM!
1 Like