Alright, so I have a fully functional inventory system, EXCEPT one simple thing…when I pick an item up off the ground and go to destroy it and place a copy/reference of that actor in my inventory, it gets deleted from my inventory after garbage collection.
So you say to me, well just spawn an actor of that class with the “Spawn Actor From Class” blueprint, but here is the dilemma…
My items that are pickable (from the ground) are a CHILD of a placeholder class, therefore that suggestion will NOT properly work out for me.
I have the code for when the item is picked up/destroyed within my placeholder class blueprint so that it affects ALL of my children (items to be pickable), so the items are essentially not able to be called from “Spawn Actor From Class.” … Does anyone have a solution I can look at?
Here is a summary.
- I chose item to be picked up from ground.
- I place actor (reference) in my inventory and set it’s owner.
- I destroy actor.
- Item is removed from inventory because all instances of destroyed actor are removed from garbage collection.
- I cannot find a way to use “Spawn Actor From Class” in any way to get this to work.
- If I start copy/pasting all the code from my placeholder class to every item in the game, that would be redundant and would not make sense to me.
- Any suggestions?