Get enemy to attack random position of collider/mesh

WillyG99

Member
Hi!
I have enemies who get the same target, a defence barrier by following a tag. Problem is enemies all strike the center of the object/barrier. How do i get the behaviour to attack a random position of the collider instead of all of them grouping up in the center?Screenshot_5.png
 
Are you using the character controller? If you are you could increase the spread distance on your shootable weapon. If you aren't then you'll need to add some sort of randomization to your fire method.
 
Enemies only use behaviour designer, they don't have guns, they are zombies so they only strike the barrier, problem is they all strike the center of the barrier
 
You will need to apply some sort of randomization to your strike method. You'll either need to return a new Vector3 with some randomization depending on how you are determining your position.
 
I'd put empty game objects with the attack tag as children of the wall.

Right now, they all get the same attack position which is the center of the wall. This would spread them out along the wall.
 
Top