so for the last week i have been trying to make something work and i just gave up on it. i have a bunch of enemies spawning as waves and they follow you and if they touch you, you lose a life. pretty simple stuff, but when you are fighting them they eventually end up behind each other in a straight line, and i dont want that because it would make it so easy to kill them by shooting.
so i am trying to make the enemies detect when another enemy is behind them so that they kind of spread out a bit.
AAAAND…I’LL admit it i have absolutly to clue of how to go about this.
first off i started looking for assets that would make it easier but can’t seem to find any.
i have tried using raycasts but its tough to make it work
tried using empty objects having a trigger collider on it to detect using OnTriggerEnter()
but had lots of problems with it.
my final try was to use the ‘’ vector3.dot ‘’ but i cant seem to understand it.
i want any solution, maybe using the dot product to detect if the enemies are aligned on one axis (z)
litrally any solutiong would help, asset, script, anything…
also is there a way to use the navmeshagent.move() function to move the agent in local space.