Help with NPC for sniping game. Part 1

So I’m working on another project about being a sniper, killing both good people and bad people. So how do I make the good people scared after one is killed and starting running all over the place?

hi try to add an object variable like panic_now to the people put people into two groups GoodPeopleGroup, BadPeopleGroup so then you can control every instance in the group with a foreach and check if their variable panic_now is true or false and act in kind.

ForEach Goodpeople
– if panic_now = true
----- Run like hell

ForEach Badpeople
– ForEach Goodpeople
---- if panic_now true
---------- Laugh of them

Then, how do I make them move to random direction after they’re panicked?

Add a pathfinding behavior(if topdown) and make a sprite called a destination on the opposite side of Player. And set its destination to sprite destination

Ehh, somehow I still can’t make it work. Can you help me a little more?

the distance between good_people and sniper = random px
button shoot is pressed
panic_now = true

ForEach Goodpeople
– if panic_now = true
----- Run like hell

It worked! Thanks a lot!