EDIT: sorry I posted in the wrong forum, I followed a google link and it took me to previews forum instead of the main forum, i reposted the thread here: Behavior for long range enemy when player is too close
feel free to delete this thread, mods
- I’m working on the AI system for an action game. My question is about pathfinding. I have a long range pathfinding a position a bit far from the player say I want it to be 5 units away for it to stop pathfinding and do an attack. What should I do if the player gets too close? how can I tell the enemy where to go if it’s TOO CLOSE
- keep in mind the levels are randomly generated so I can’t make predetermined spots for it to go should I just make it raycast in a direction away from the player and go to the hit point if there’s nothing in the way?what if the enemy is a corner?
- should I make it so the enemy has a short range attack and have the enemy attack until it dies?
- how do games typically approach this problem?