Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: Athin on April 05, 2019, 09:10:59 PM
-
Hey guys,
I'm making an RTS style project featuring large armies. When I got two armies fighting each other, that initial clash tends to be both sides focusing down 1 guy (The one that triggers the fight) before spreading out to different targets.
I'm hoping this action can find the closest target and have a Loop event into a new state. At that state, I can check if the current target is engaged and then loop back to find the second closest unit if needed.
Not sure if there is something out there already for this but I couldn't seem to find anything.
Thanks
-
Hi,
What you need is to maintain a list of them objects in a sorted list, so you can pick the nth closest object.
there is an action for this ArrayListSortGameObjectByDistance
Bye,
Jean
-
Hey there
Awesome, didn't know about that action. That will work perfectly for me
Thanks