Hello,
using the navmesh agent in unity in a 2D top down game, i wonder how the masses of bodies can be controlled:
Currently my agents move on the field pushing each other away and trying to find a path with just the nav mesh agent component and the navmesh baking applied.
The problem is that targets of many agents are being pushed arround rather than applying force against the incoming force of all the agents.
The logic is programmed, that there is a given order of attacks which means an agent far away from the target is up next but there are a lot of agents in between which prevent the target and the current attacking agent from colliding. My idea was to increase the speed on those agents to allow them moving through "waiting to attack" agents. This seems to work quiet well, however, the agents will push away the target until it collides with a boundary which does not look very good (imagine the big bad boy being pushed away - impossible!)
I tried to add a rigidbody2d to the unit and play with the mass during runtime, however it does not change any behavior (?)
Is there any flaw in my setup or am I missing something?
Greetings
↧