We want to achieve a group of agents were absorb by the spacecraft.
Open the sample file, you can see we've built a scene with a road and some cars in it. Also there is a spacecraft in the middle air moving forward, and we we want our agents to run follow the road, avoid the cars and finally are absorbed by the spacecraft.
We made the cars area as the combined meshes zone, please notice that the zone is combined by several meshes into a single mesh although it looks like separated.
And we create a moving spot and a logic with it, when the distance between the agent and the spot less than 750, agents will be lifted up by drag force toward the spot direction:
We have a group of running agents at the start point. the will do the following logic:
- run follow the road
- avoid the cars
- absorbed by the the spacecraft
- spot absorbing near by spacecraft and hold onto it
And we translate it into the logic of Miarmy:
- follow road
- avoid zone
- follow the spot when near it
- slop moving when near it
These 3 logic nodes, avoid each others, follow road, and avoid cars, we made by the simple sentences:
And then, when the spot (spacecraft) is near which distance less than 750 (maya unit), we make our agent move toward it.
When agent is left, we rotate to left and follow it, and also we move up and forward to lift.
When they are moving up, their hands, legs are all enable dynamics, and the body will rotate for some random degrees
After they moving into the bound, they will be parented into the bound and play action:stand and stop moving.
It is done, now we can cache it and render it: