[Solved] Create an item for each free slot

Yes, that’s right, that’s what I was looking for! Thank you so much @MrMen you’re great !!!

Guys, I thought I had solved it but when I exported the code to my main project I noticed that if I create random spawn points this is what happens
mmmm

Are those boxes just rising and falling all the time, to attract the player’s attention? If so, the issue will be because they rise above the spawnammo and there isn’t a collision between the two.

So you’ll have to check some other way whether the spawnammo object has a box on it. As @Keith_1357 wrote earlier, linking the two would be the easiest option, just remember to delete the links when the box is collected.

Guys, please help me. In addition to moving the crates, I’m now also having problems deleting them… why?
I enlarged the spawn points, linked the items, and created a Boolean variable as recommended, but this is the result.


boxxxreg

How did those two lighter coloured boxes get there? Were they already in the scene? If they were, then, they haven’t been linked to a spawnammo object.

The lighter box is part of the same group called box. It’s just a coincidence that two lighter boxes appeared in the GIF; the same thing happens with the dark boxes.
this is a copy of the project if you can please take a look

I understand you have an object group named box with 2 differently coloured boxes. What I meant was were those 2 boxes already in the scene from the very start, or were they generated by one of the 2 events?


I’ll have a look once I get home - WeTransfer is blocked at work.

the clear boxes were not in the scene from the beginning but were created

I messed around with it and got it working. Sorry, I haven’t looked into why re-arranging some of the conditions or linking box to spawnammo rather instead of spawnammo to box makes such a big difference, so I can’t explain it right now. There was a bit of intuition involved.

Anyway, here’s a link to the fixed json game file.

1 Like

Thanks again for your kindness @MrMen