Line formation help

Hello,

Im a ue4 noob and not sure where to start when getting Ai to form formations like a Line formation

If anyone has any idea or even better has an example on how to get AI to form formations i would very much appreciate the help!

To line up is simple get all the actors to keep one axis to a value and just change the other axis accordingly.

For example. My character all gonna line up on X location of 100.
X will always be 100 because they all line up on X.
Y first character will be on x100, y100, then I’ll just add my gap of 100. So 2nd unit will be x100, y200. 3rd unit will be x100, y300 and so on.

Thanks for the suggestion but what about rotation? And do you have a example of that system? That is hard for me to understand from written text

You can experiment with something like this initially:

The only thing it’s not showing is the unit selection -> the clicked actor sends its reference to this blueprint via a cast. Click events enabled in the controller.

Animated end result here.

edit: most importantly, I should have said that you can rotate a bunch of vectors around another vector

Alternatively, you can attach actors / components to one another and rotate the whole lot.

Not sure what you’re planning with this, but generally speaking - you’d want to generate a bunch of target points and move individual units there over time. Again, the implementation will depend heavily on what you’re trying to achieve. Like with pretty much everything.

1 Like