Service blueprint Get All Actors ForEach loop

Hey guys,

After I followed the basic behaviour tree tutorials. I thought I’d edit it to my needs. I want to find all instances of a specific actor class. Then I want to check the line of sight to this object and aggro if it was found.

However, running a foreach from the 'Get all actors by class ’ node gives me compile errors (which are not there when doing this in a normal blueprint). What am I doing wrong?

I will take a screenshot later today, but maybe you guys can already tell me I’m doing something stupid.

So as promised I will upload a screenshot of my blueprint. The issue is really quite vague to me, I hope you guys know more.

Screen Shot 2015-02-11 at 10.43.32.png

Please help me out because I’m really stuck at this part. Nothing I try helps, deleting starting over. Each and every time this happens.

Try this

Put the cast inside your loop, then link the array in to the GET.

If that fails, try casting after yo get.


Hi Narg,

Thanks for your reply. After I made my own foreach loop I figured out what caused this strange problem/bug. I had to delete the stuff in the lower left corner which was old tutorial blueprint stuff. Although it said the upper ForeachLoopBreak was the problem, it seems this (not connected) code down below was causing trouble.

So for everyone else running into problems like these. Remove redundant blueprint code, even though it might not be connected. Now everything works like a charm, my AI is alive :smiley: