Exclude every object and just one

in theory this should make it so if the zombie has its value. which only one zombie will have. it will then pick the nearest survivor and move to them using the pathfinding extension. however instead all the zombies go to attack the closest survivor to the first ever spawned zombie. all of them. not individually checking for their own nearest survivor. but only the first object created. i also have a lot of other examples of this same problem. any help would be fantastic!

the issue may be that when it is moving the zombie to survivor position. it may be moving all zombies. instead of one. or maybe only setting one survivor location. it could be both. and my game is impossible to make without fixing this lol. any help would be appreciated!

No, the issue is with the conditions:

The first condition picks a survivor closest to the first zombie in the list of all zombies. Is filters the survivor, not the zombies. And so all zombies are selected.

The second condition say “if a zombie’s zam value is equal to it’s zam value”. This will always be true for all zombies.

The action then applies the list of zombies, which in this case is all f them.

What are you trying to achieve? Which zombie are you wanting to move, and what is the significance of the value zam?

zam = to zombie var zam was a strat to be used whenever a survivor was transferred to a zombie. kind of like an id code. i am trying to achieve. so like each zombie has a mind of their own and any zombie can go up to the closest survivor

i changed the code as you said. it picks the zombie closest to the survivor’s position. but now only one zombie goes around and eats people. lol once somebody turns they run after somone while the previous zombie just stands there. i may know a fix

Then you’ll need to use a For each zombie object event, finding the survivor closest to each zombie and move the zombie as you iterate over them.

OMG. I COMPLETLY FORGOT THAT EXISTED LOL. thanks so much. i havent been on gdevelop for months and im running at like 2 hours of sleep for the past 4 days after a project ive been working on for a while got wiped

ok. so ive done exactly that. and i know it works because ive used it before… but it still aint working. the zombies dont even move

Try this:

does not work

dammit i did it the wrong way

Why the nearest survivor in the conditions, but army position in the actions?

because my brain can barley function

it is working. thank you very much!
im going to go to sleep for like 12 hours now. thank you and goodbye

1 Like

and let me know if it is possible to recover saves from the cloud when develop crashed. loaded in and its blank