Download

Inventory Help

I have a base class for all the items i am able to pickup; I use a struct for this.

Inside the two child actors they are setup like this.

bdd7a01e86512b7b6e6aeb7ab20d78ed279af567.png

When i pickup an item it sets my variable “ItemInfo”

b6c780437e039d01164dbf5414b63c082c3ee1c8.png

The only problem is when i pickup a gun it sets my “ItemInfo” variable but then when i pickup another gun it overrides my previous settings for the variable.

Here is a video of what the problem is like in-game.

As you can see from the video the variable gets set from what is last picked up and this causes a problem because i cant drop any other item but what was last picked up. Any ideas on how to fix this?

You need a collection (Array) of weapons stored somewhere. When you pick up a new weapon, add it to array of weapons instead of a single reference.

here’s a very good tutorial from titanic games Unreal Engine 4 - Inventory System Part 1 (Part 11) - YouTube