Download

Problem inserting data into array of other blueprint

Hi everyoune,

i have a strange Problem adding objects to an array of another blueprint.
First of all i have the following scenario.
there are Activators which can be triggered and Activatables which can be activated.
A Activatable can be activated by one to “unlimited” Activators. Therefore the Activatable got a list ob all Activators.
At the start of the game the Activatable registers themself at the Activators in order to be able to be accessed by them.
At first i used a single variable to save the owning Activatable and everything was fine.
After that i decided that one Activator can be part of several Activatables. therefore i tried to save the owning Activatables in an Array.

AND HERE COMES THE PROBLEM:
here is the “code” from the registering. The input array is the ListenToActivators with a list of Activators.

The Activatables seem to register themselves in the variable and in the array as well. (both ways)
I can also see that the length of the Activatables array is the right one.

If I now try to work with the data, the reference from the Activatable variable is valid and works.
the references from the array on the other side are not valid and therefore useless…

Does anyone know what i am doing wrong or how to fix this problem?

I did not (try to) figure out the BP’s ; but maybe this would be easier with Events. The Activators will then “listen” to the Activatables; no need to put them in an Array (for this function)

I got an example from Billy Bramer; maybe you can use this example also:

That was a great idea!
Worked perfectly ^^

If you now can tell me if it is possible to replicate input events from an client to the server you are my hero?
Or to trigger some kind of event.

Good to hear it worked. I did not focus on cl/sv yet; so I can’t help you there. But if you look at the example of Billy; in point 2 he suggests how to do it for a Network.