I also made a parent Master Item with only a print string and destroy actor.
What im trying to do is make a child BP from my master ITEM sample is: gun , flashlight, consumable etc.
my problem is I dont know how to make my player BP know what I picked up. My player successfully Destroy the actor it hits with line trace.
From the first graph it appears you already have a Item return type from Interact, so I think you are already well on the way. Just have the Interact within the subclasses return the appropriate struct. Or am I missing something?
Side note: If your item actors are not very complicated/different, subclassing is very heavy handed, better to just handle it all in one class (with instance editable mesh, item, etc).
yes, i made the return node have an output of a structure with name and icon.
I can successfully print the name of the child BP i hit with line trace. but I dont know how to make my player character recognize that the actor is already picked.
sample is: I have a flashlight in my world as a child BP of my master item.
I am successful to print the name of the actor I hit .
but I still cant make my player character use the flashlight. I dont know how to do it.
You will need to test the Name field in the struct returned from Interact. With the Set happening where you currently have it you would need to also have Generate Line Trace return the struct it gets from Interact.
Given the Generate Line Trace is a function on the character, you could of course just do it there too.
In general, this looks like a very rigid system that is probably going to fall apart as you add features…
How many items is the character able to pick-up? Can they switch items?
A handful of booleans will be fine if you have three items in the game, but if you intend to add many, this will not be manageable. Recommend you look into inventory systems, as semi-suggested by Clockwork.