This is for a Beat Em Up game template. Awhile back @Everynone showed me a simple way to make an enemy player seek the player without a nav mesh or AI tree etc etc. You can check that thread out here.
This is as far as I’ve gotten on an Unreal project btw (so I’m pretty excited). Here is the situation, like a typical Beat Em Up game you walk up till you encounter and enemy and the camera stops, and you are locked in with the enemy. You can’t advance untill you defeat them.
They approach the player, and will attack when right next to the player (Im still not solid on the enemy movement and attack mechanics).
BUT, when the third person character dies and respawns, the enemy will not attack, nor seek the player. I at one time had it where they would seek the player, but they would strafe walk and could not turn around to face the player, and would not attack again.
There would be so many screenshots to show this level blueprint. So I’m just going to try to use my blueprint ue to show it.
So i have simple BP for my enemy they have the task to move to a fixed location if i come close to them in range they will try to attack me and follow me with pawn sensing. If i go out of the sensing range they continue on they’re path i set them to go. They dont care if i respawn they will still going to the location and aways attack me when i come close to them and start fighting me again and follow me till i get out of range or kill them and so it goes…
here is how it works and maybe you can implement some of it for your ai is really simple but works flawless so far…
Here is the simple logic that @Everynone suggested once to me that gets the enemy player to seek your player. It works pretty good. The problem is it seems it is only good for the first life of the player and possibly other things and then the players stop walking, and stop attacking.
I just made a video of it and you can see their behavior in this. When I made this vid, it seems that after he respawns they walk right past him like he is not even there…Hey I know the feeling lol…
Might need to bump up the sight radius and peripheral vision a bit. And on player char you would need to add a Perception Stimuli Source component with sight config in the settings.
As of right now, they do keep punching and turning after a respawn, just not moving. And that kind of proves the gate did not stop the event tick or they shouldn’t be able to turn.
Thanks, I’m researching a lot of old Beat Em Up games trying to determine how the enemy moved. Ok I will need to figure out a way to implement pawn sensing a long with collision boxes. Maybe I could use pawn sensing just to get them to move. And collision boxes for everything else. Thanks for checking it out.
Here is a short 3min tutorial but very effective how to set up pawn sensing and then how the enemy character will move to you when they see you. In beat em up like your game i guess they should see you immidiatly, so make the pawn sensing range big enough. And then after they walk to you put your fighting code just after that and they will start fightning when they reach you.
Btw i see he is using unreal 4 and when you add the pawn sensing component you can click on it on your character on the left and on the right site in the details panel scroll down to “Event” then click “On see pawn”. Is the only diference if you cant find it like he do on his unreal 4 version the rest you could follow as it is and it should work.
However I don’t see many options that you have. On my Target Perception Updated node, like yours on the bottom has the boolean output where you set that bool. What am I doing wrong here? Thanks
Yeah, their sight should be very high and with them instant turning to face you there should be no problem for them seeing the character. I watched that video. I don’t know much about AI but know you do need the nav mesh.