[BUG] - The type of Target Array is undetermined

Hello!

I have an issue where arrays spontaneously stop compiling in certain Blueprints. In this particular case, I have a type of BTTask_Blueprint that is supposed to do the following:
A) Get all actors of type from the world (will cache this instead of using an iterator later down the line)
B) For each of these actors, get their tag and compare it with the desired tag.
C) If we find the desired tag, set blackboard variables, and finish executing.

There are two paths in the example, one if we already have a current actor (Current POI), and one if we do not, as we don’t want to get the same actor twice in a row.

I can’t pinpoint exactly when the blueprint stops compiling, but it seems to be when both of the primary actor for each loops are already connected, and one of the secondary string for each loops is connected - after the second secondary loop is added, the blueprint will no longer compile.

After this point, it is impossible to get the blueprint to compile without deleting all of the array nodes - disconnecting the nodes is not sufficient and they must be removed completely.

The errors look like as follows:
Error The type of Array is undetermined. Connect something to ForEachLoop to imply a specific type.
Error The type of Array Element is undetermined. Connect something to ForEachLoop to imply a specific type.
Error The type of Item is undetermined. Connect something to ForEachLoop to imply a specific type.
Error The type of Target Array is undetermined. Connect something to ForEachLoop to imply a specific type.
Error The type of Target Array is undetermined. Connect something to ForEachLoop to imply a specific type.

Here’s an image of the blueprint itself. I’ve tried setting up a generic version using a normal blueprint, but could not reproduce this specific issue (Note answerhub makes it insanely small, but if you get the image URL and open it up in a new window it should be readable).

The issue is occurring in 4.6. I’ve googled around and only found one other reference to these error messages, and the post was quite old, without a solution :frowning:

Thanks!

Luke

I have this problem as well, this is happening when you duplocate or copy/paste for each nodes and hook them up to a different array.

Easy temp solution is to click and drag from an array output and type foreach, recreate all the nodes, and it is fixed.

Just commenting for visibility. I am also experiencing this bug. The workaround is viable, but obnoxious to have to deal with (thanks for finding it, Roel!)

Hello, i’ve had the same problem, and i found that when you copy a foreachloop node (ctrl + c, ctrl + v), can do a bug where you can’t compile and for each loops goes in red. maybe beacuse copying it attached to some reference can do this bug. try to delete all the nodes that you remember you have copied,and put it manually one on one from new, it helped for me. Also try to open and compile all you blueprints and structs if you haven’t try before.

I’m also experiencing this bug, even though I’ve done the workaround from Roel.

Thank you, you solved my situation too