how can i build a backpack in my game.i need put so many things in this backpack
Hello, baiyunshen1 and welcome to the Unreal community.
Your question left out a few specifics but I can direct you to some of the free content on the Marketplace to assist you.
Here are their names:
Inventory UI with UMG (Legacy Sample).
Horror Engine: Which has a very expansive inventory system to check out.
Point and Click Adventure Toolkit: Its free for the month and has in-depth documentation to help you along the way.
You can find all of these on the Marketplace.
I hope the examples assist you in your development.
Hey @baiyunshen1, I strongly recommend you follow the advise by @Polite_Muon. Also, there are many ways one can go to achieve a backpack system, so it really relies on the needs of your game in specific.
As a VERY general approach, I would say you would need to create a UObject class (UBackpack) that contains an array variable (this also depends on your game, you may want to have specific slots instead of a general array) where you can store your different items. The type of the array depends on your game, maybe you have an Item class, maybe you store Actors, depends on you really. You would also want this Backpack class to expose a set of public functions so that you can use it from other parts of your code. As a very minimum you would need a function to AddItem, RemoveItem, GetItem and GetItems (plural to get all the items in your backpack).
thanks bro,i dont konw how to say this question clearly,i will follow youe advise to work,thanks everybody help
thanks bro,maybe i could learn more about packback,do you have any contact information for me to contact you?if you have a free time ,i want ask some question,thanks bro