I’m developing a game that player can control multiple troops like infantries, riders, Archers and so on. Question is I want they move like a whole troop. How should I control them? Is CharacterController
a good choise? But should I attach the CharacterController
to the soldiers or to the troop, which is a GameObject holding all soldiers in the troop. I want they keep in formation but can adjust their position during fast moving and back to their position when stop. Anyway, the detailed control has a low priority, the most important thing is how can I move them and animate them. I am currently using a CharacterController
attached to the troop GameObject. And I set the animationclips in a script attached to all the soldiers. And beside CharacterController
can I use a rigidbody to control the movement of my troops?
For realistic troop movement you want a flocking algorithm.
This is the classic paper on them:
You can find a concrete example in this book (in C++)
You can find a general dissuasion of them in this book: