0
Fixing

How to do Multi-Item On Drop Trigger?

Cr4shBarcode 5 months ago in Inventory updated by Syed Suhaib Zubair 5 months ago 3

Several of the puzzle items I'm creating in my game require more than one on-drop trigger, in order to respond to more than one inventory item, but it seems like each object is limited to one trigger. How might I get around this?

For example, say I have an object-- let's say it's a Dish. 


In my inventory I have 3 different Coin objects, and I want the Player to be able to drag each Coin into the Dish and have each Coin appear in the Dish. 


This requires the Dish object to have 3 on-drop triggers: 1) a trigger for the big coin, 2) a trigger for the medium coin, and 3) a trigger for the small coin. 


Right now, only the trigger that is at the top of the list in the Inspector tab fires. The other triggers do not fire, unless I rearrange their position in the Inspector, but still, only the topmost one fires.

How do I get around this? I tried adding multiple colliders to the Dish object, which did not work. I'm not sure what to do, but there must be a straightforward solution.

Unity version:
Game Creator version:
+1
Fixing

Excellent question! In fact, there's a bug in the Inventory that prevents an item from triggering more than one "On Item Drop" Trigger. This has already been fixed in the Inventory update I'm working on at the moment, and should be available in the following days (tomorrow or Monday, since Unity doesn't review during weekends).

After the update, this will work out of the box, without you needing to configure anything. I'm leaving this thread open until you verify that this is indeed fixed in the follow up update.

+1

Please kindly add a system in inventory to drop some quantity of ammo out of total or anything using a slider to select quantity to drop.

Thanks, sounds exciting!