UIS/UCC Add Item - Timeline

Hiiyan90

New member
Hello! How might you suggest the best way to add an item to a to the UCC player inventory would be using timeline?

I have tried a few different things but nothing seems to work consistently. I have searched for an "add item" line of script to add to a game object to activate and hopefully automatically add to the players inventory but I have not found what I am looking for.

Could you possibly point me in the right direction?

I found this page:

But how do I specify the players inventory? If there is a better page I should be looking at I'm happy to keep trying to figure it out! Unless there is a better way involving timeline?

Thanks!
 
I'm not sure I understand the question. It doesn't matter where you do it from you can add items the same way from anywhere using:
Code:
//Get the player inventory using the Identifier ID in this case 1
var playerInventory = InventorySystemManager.GetInventoryIdentifier(1).Inventory;
//Create the item you wish to add either by name or using the Item Definition.
var myItem = InventorySystemManager.CreateItem("MyItem");
//Add 1 of MyItem to the player
playerInventory.AddItem((ItemInfo) (1, myItem));
 
Top