[Solved] Deleting all same food off many counters and recreating them on a single counter

This part in my project I need to take food off the machine and put it on empty counters. I came up with this:

Which may be riddled with errors, first time trying to link things, but seems to do what I want it to do. Not really sure why though.
Now if all my counters are full AND the next food I’m trying to take off the machine is the same as multiple counters I would like to delete the food from all the counters and create one pile of food on one counter. So far I’ve been unsuccessful to figure out how to get all the counters to “combine”. Anyone have suggestions or examples/tutorials to point to me thank you very much.

I’m not quite sure if I understood, but let’s assume I did…
You would need to use the 'for each object’ and do:
for each counter, if foodA is in collision with counter (or whatever means you use to link both), add 1 to variable numberoffoodA. That way, you know how many foodA there are in total.
And when the for each loop is over, do a while loop:
while numberofffoodA >0, create foodA at position 321;123 and do: numberoffoodA - 1

Beware, if you don’t use the while loop properly, the game will freeze.

Okay okay, I think I understand what you’re saying, and it sounds like it should work if I manage to do it correctly. Thanks a lot I’ll give this a go.

1 Like