Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | fairyhell |
Hi, I’ve come to a problem while making my 2D game tho I might find a clumsy way to work around, I’d like to ask the most efficient way to do it.
I have a ‘player’ that can pick up item on the ground, while checking its “colliding bodies” is in “items” group.
The problem that when many items are in the group, my ‘player’ pick up everything in one go.
Edit: All my items using same ‘scene’ for items.
So what is the most efficient way to make it to pick up one item at a time?
You could keep an array of all items you are overlapping with. Then, when pressing the key/button to pick an item up, select the first item from the array. This is both efficient and fast.
FortunePilot | 2020-04-20 15:09