Selecting/Controlling multieple pawns (RTS) issue

Ive got a pawns that are controlled by a custom AI controller, and ive got a player controller that supposed to comunicate with AI controller, but it doesnt work unless i use GetALLActorsOfClass.

If i do a trace and add the result to the Actor Array it also doesnt work. Ive checked the Actor array content and its all good.

If i use GetALLActorsOfClass and Set Actor Array than the actors of GetALLActorsOfClass will be saved to Actor Array and it will work.

So here i have a dilema how do i suppose to select pawns using trace if the trace gives a different result.
Both GetALLActorsOfClass and trace produce result - actor type, but for some reason they are different, becouse using the line trace (object) result will result in failing to cast to the custom AI controller.

Its as if it doesnt care about the actors themselves but the actor ai controllers…

Ive posted images and more text in my previos topic/question:

I may be a bit confused but it seems like you are getting all of class AIController with the get all node while the trace route is actually getting type Actor.

To get the same result with the trace you need to get the controller for that hit actor and store it instead.

Can you please show a small example, im not sure how to do that. I tried get owner when breaking the result but it returns null. And any casting fails!

I am away from the comp for now but try getting Controller instead of Owner. This requires base type pawn of course since they are the only ones with controller. You may want to ignore any actors not of the proper type in your trace either in the “trace by” property of the trace or after the trace with a simple cast succeed/fail check.

Yes thank you so much RimmyD, ive finaly figured it out, heres how ive set it up:

Awesome! Glad you got it workin!