Event not firing after getting registered. [c_Inventory_OnAdd_ItemInfo_ItemStack]

The system utilized in this use case is the Item Shape Inventory.

In a test script to test out the different events i noticed that when i add an item to an item collection such as the main collection in my case the default opsive event c_Inventory_OnAdd_ItemInfo_ItemStack is not triggering the respective method - action call when the event should had fired.

Bellow is an attachment to the code in reference, in hopes of giving a better insight to what i could had done wrong.

The addition to the inventory collection is done like so :

C#:
ItemCollection inventory = InventorySystemManager.GetInventoryIdentifier(1).Inventory.MainItemCollection;
inventory.AddItem(myObject.ItemInfo);

Lastly The item appears properly inserted in the item shape grid, as well as in the item collection in the inventory component.
 

Attachments

  • OnEquipGunEventListener.cs
    891 bytes · Views: 5
I just tested the code you sent, it works just fine.

Just to be sure did you add your OnEquipGunEventListener component somewhere such as on your player?
Make sure you are indeed calling the Start function. That's the only reason I can think of that this isn't working.

Either that or you are using a custom Item Collection that does not let the inventory know that an item was added.
 
Top