So I’m trying to setup a basic inventory system. Originally I had it so that items that were able to be acquired could be clicked on, then the actor would be destroyed and all the coding for what the item did was in my character blueprint.
I couldn’t get a functioning inventory to work well like this so I watched/read a few tutorials and changed the system. Now I have an actor named “BaseItem” that is essentially an item that can be acquired. When it is clicked on the actor is destroyed like the older method only if the player character has enough room in their inventory. I’m able to recall anything that’s picked up and the system works fine.
My only hang up is that now the only item that works with the inventory system is that BaseItem actor. So instead of duplicating that blueprint a ton and adding a bunch of stuff to my existing blueprints I thought about something: can I make the baseitem blueprint have a variable that is set to instance editable and depending on whatever the variable is the blueprint calls another actor and that is the actor that spawns?
Basically right now the only thing you can pick up in the game right now are a few guns, a flashlight, and some medkits. I was trying to use eventbeginplay in the baseitem blueprint to establish what actor is actually spawned but haven’t had any luck. Was just wondering if someone’s done something like this or if there is a way to use the baseitem actor as a vessel to spawn any one of my items.
PS - I tried setting my variable in the baseitem blueprint to an actor and use that to get that actors components so I could assign the static mesh to the mesh of baseitem but I’m going no where.
Thanks.