Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.alt text

Product Version: UE 4.19
immagine.png (87.4 kB)
more ▼

asked Jul 02 '18 at 08:00 PM in Blueprint Scripting

avatar image

1 1 1

avatar image Nebula Games Inc Jul 02 '18 at 08:36 PM

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.

avatar image MrBertoS Jul 02 '18 at 08:49 PM

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 it*strong text*

avatar image Nebula Games Inc Jul 02 '18 at 09:23 PM

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?

avatar image MrBertoS Jul 02 '18 at 09:44 PM

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.

avatar image Nebula Games Inc Jul 02 '18 at 09:49 PM

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.

avatar image MrBertoS Jul 02 '18 at 09:59 PM

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

avatar image MrBertoS Jul 02 '18 at 11:12 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question