Why does a foreach loop from class into a get all actors from class not work?

I have this blueprint:

The array element of the second foreach loop should be able to attach itself to the empty targets or at least get new ones, this isn’t the case, it doesn’t get any custom variables from the classes in the attachCheck variable.

If I compile this I get this error:

COMPILER ERROR: failed building connection with 'Array of Green Object References is not compatible with Array of Actor Object References.' at  Get (a copy)
Can't connect pins  Out Actors  and  Target Array : Array of Actor Object References is not compatible with Array of Green Object References.
Invalid pin connection from ' Out Actors ' to ' Target Array '. You may have changed the type after the connections were made.
Can't connect pins  Target Array  and  Out Actors : Array of Green Object References is not compatible with Array of Actor Object References.
The current value of the ' Array ' pin is invalid: Array inputs (like 'Target Array') must have an input wired into them (try connecting a MakeArray node).

Is there a way to make it so that it does or is there a workaround?

Try using blueprint interface after second loop

That is not going to work, I need to get up, down, left and right in that blueprint not another.

I correctly understood, you need the values of variables from the actor, which you get from 2nd loop as array element? Then why you think that interface don’t work?
And about compiler errors – if you will use interface, make sure that input type of 2nd array is object or actor.

As example:

220739-1.png

Can you show me where you have the canBuildSurfType event? I can’t seem to find any spot to put it in my actor BP’s.

It custom event from blueprint interface.