Vending machine destroy code

Hi there, im trying to create a vending machine that spawns items.

I can spawn an item from it and can destroy the item on collisionStay (so if left about), however if the item is picked up and held it still gets destroyed and I would like it to not destroy the item if held?

Hey there, I’m having trouble with something just like this! except i’m having problems spawning the item- if you’d be down to give me a hand with how to maybe spawn items in? assumingly globally? it would indeed be great.

What i’d recommend is something of a maximum amount of items you can have, for example, no more than 10, it depends on the items’ polygon count, if it’s very low poly, you’ll probably be fine with a decent few hanging about. But if it’s high polygon count, better keep it low, that’s the solution I came up with.

If you’d be able to give me a hand with my trouble too, it would be greatly appreciated.
link if you’re interested: Trouble creating a working vending machine

So i ended up making an object pool with 10 items in it with (OnInteract ObjectPool TryToSpawn with a Shuffle to do it at random)