Problem with spawning actors

Hi everybody,

I’m having a lot of issues with this blueprint: i want to spawn an actor from his class and set a variable, after this i want to spawn another actor from the same class and give to this another variable, in this way i can attach the first actor to my character, and the second one to another character.
The problem is that when i try to setting up the second variable the set node split in 2 variables:target and “Zaino Piccolo Rec Ref”, and i can’t set the variable for the second actor created.

I think you have 2 similarly named variables. The first is within the Zaino Piccolo BP that you are spawning called “Zaino Piccolo Ref”, you have it exposed on spawn and could simply set that variable directly from that input pin on the “Spawn Actor From Class” node. The second variable is the “Zaino Piccolo REC Ref” which needs a “target” because it is not part of the “Zaino Piccolo BP” which is where you are trying to pull it from.

Thanks for the answer,
The problem is that both the variables are part of the same BP, my problem is that i want to set a variable from the result of the first spawn, and give another variable to the secondo actor spawned, but i don’t know how to do itstrong text

Sorry for my bad english, i spawn first actor and want to set a reference to the result and call it variable A, after this i create the second actor and want to set a reference to it called variable B, the problem is that i can’t set the variable B, i don’t know why but it seems that i can’t spawn two actors from the same class and givedifferent variables to each one.

Not sure what you are trying to do then. Mind clarifying? You have 2 variables in one actor BP, variable A and variable B. You spawn your actor BP and want to set variable A to something. Then you spawn a second actor BP and want to do what exactly? Set variable B? I am confused…or do you want to get variable A from the first actor and use it to set variable B in the second actor?

Why don’t you explain what you are trying to do “game play” wise not blueprint wise and then maybe I can help you because I am just not understanding what outcome you are trying to achieve. You started off talking about attaching a spawned actor to a character. That shouldn’t be hard at all and you can def, spawn multiple actors and attach them to different characters. My issue is, first I don’t know if that is even what you are trying to do and second if it is then these variables are very confusing the way you have named them.

Ok i want to create a HUD widget live so when i attach a sword to my main character i can see it in the widget in the inventory menu.
I have a character that spawn away from skysphere with scene 2d camera etc, i can spawn the two swords and attach to both the characters, the problem starts when i want to remove the swords from the characters, cause i can’t set the variable from the second actor and so i just remove the sword from one of the characters.
When i set the variable from the result of the secon character it create that strange node with “target” and “zaino piccolo rec ref” instead of the usual node with one input and one output

Ok i made it, thanks for your suggestions they where essentials, i was setting the variable in the wrong way, i needed to set it before … thanks a lot