Why is my array not passing a variable from a blueprint to another?

Im sure this is a super noob question but, for the life of me i can’t figure it out…
Im trying to pass an array variable from a blueprint onto another and spawn an item from that given list.

Any ideas why this isn’t passing any info???

I would say it is because your Array is Replicated. So i guess you are running a server and a client. Only a server is allowed to spawn something and the replicated variable could be empty on clients. Watch the Network Tutorials on to get a hint how to spawn something and check in the blueprint if what value the array has at runtime.

See if it’s because of collision. Check if “Spawn Even if Colliding” helps.

So, collision didn’t help and the main bp has the exact same code under begin play and it works.
I tried creating a string variable and printing it on the new blueprint and it comes out empty, so the problem seems to be on the passing of the information.

Any other ideas?

Hi ronaldk,

How are you going about casting from the blueprint you are giving the variable in the array to and the array itself?

Hi , Thanks for responding. So, this is what i have so far…

Blueprint one sets up an array on construction and populates. Variable is replicated with notify. On event start gets the array, looks at item number 2 and spawns it. – perfect.

Now, blueprint 2:

It has a variable that references the previous blueprint. Reads the index and should spawn item 2, but it comes out empty.

I tried seting a string variable on blueprint one and printing it on bp2 with no success. The print just reads "Server: "

What am I missing?

Oh and btw, it compiles just fine, it just doesn’t spawn anything. I left the error there to highlight where the trouble area is.

What does the specific error say in the output logs? You can pull that up by going to Window>Output log

Ah I see, Well if the error is no longer there it won’t be helpful in figuring out the root of the problem :). Now, have you attempted a “Cast-to” node to cast the second blueprint to your first one? It may be that it cannot properly access the array because it doesn’t actually know where the array is.

So that was part of the question, as this doesn’t work either.
I’m sure im doing it wrong tho-- am I?

Hi ronaldk,

Try running a “switch has authority” before the cast to. Also double check to make sure that the information is replicated and not attempting to call non-replicated data.

All data is set to Replicated and adding the authority switch didn’t work… =/
Any other suggestions?.. I am a bit baffled.

Do you know any other way to pass an array from one blueprint to another?

Hi ronaldk,

If you are comfortable with it, would you send me your project? I might be able to see something I’m not seeing that would be able to assist you further.

Hey ,
Of course not, but how would I do so? Feel free to email directly.

Hey Denny,
I just saw your response. I turned off all replication and still doesn’t work. I tried printing the end value of the array and it comes out as none. Any other ideas? :frowning: