Good news! To provide faster support and grow the community, we'll be changing the forum to "Read Only" and turn to Discord instead for support.
Join here: https://discord.gg/zjNj5zZ

How to add items to a collection

yuyuko
Posts: 2
Joined: Tue Jan 10, 2017 12:56 pm

How to add items to a collection

Postby yuyuko » Tue Jan 10, 2017 1:11 pm

How to add items to a collection without picking up an object in a scene? The game I'm currently working on is a visual novel style game. I want to pick up items just by talking to an NPC in a conversation.

User avatar
jjahuijbregts
Site Admin
Posts: 2091
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: How to add items to a collection

Postby jjahuijbregts » Wed Jan 11, 2017 12:48 pm

yuyuko wrote:How to add items to a collection without picking up an object in a scene? The game I'm currently working on is a visual novel style game. I want to pick up items just by talking to an NPC in a conversation.



You can call

// At the top of your script (assign in inspector)
public InventoryItemBase myItem;

InventoryManager.AddItem(myItem);

nathanj
Posts: 223
Joined: Sun Sep 25, 2016 5:38 am

Re: How to add items to a collection

Postby nathanj » Thu Jan 12, 2017 4:18 am

Or, if you have Quest System Pro also, you can give Inventory items through the dedicated node. Not in front of my computer at the moment and i can't recall the exact name, but it's there.

With QSP you can also give items as rewards for the completion of quests or achievements which offers some more complexity to the node method.

yuyuko
Posts: 2
Joined: Tue Jan 10, 2017 12:56 pm

Re: How to add items to a collection

Postby yuyuko » Wed Jan 25, 2017 1:52 pm

How do I save the current items inside the player inventory and load it to another level/scene?

User avatar
jjahuijbregts
Site Admin
Posts: 2091
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: How to add items to a collection

Postby jjahuijbregts » Wed Jan 25, 2017 8:54 pm

yuyuko wrote:How do I save the current items inside the player inventory and load it to another level/scene?


Have a look at: http://devdog.io/unity-assets/inventory ... nd-loading :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests