I’m trying to build a farming game and I’m making the inventory. Everything seems correct. If the player collides with the InventoryItems (I put everything that needs to be in the inventory there) they should appear in the inventory box. But my collision isn’t seem to be working. If anyone can help me I would appreciate it greatly.
You shouldn’t iterate over each object and check if there’s a collision. It’s cumbersome and inefficient, especially when the number of objects increases.
Instead, create an event with the 2 conditions, and then as a subevent have the "Repeat for each instance of InventoryItems".
However, I think your issue is here:
![]()
You are creating a new InventoryItems object using it’s own name. But because it doesn’t yet exist, there will be no name to use.
Use a local variable to hold this value, setting it to InventoryItems.ObejctName() in the parent event similarly to you’ve done with ItemName.
2 Likes
Thank you so much, I’ll give it a go.
1 Like
