What can I use to accomplish this effect? (Physics + Pathfinding)

(Using A* Pro)
I am currently making a turn-based strategy game with physics, in which characters can get thrown around by explosions and the like (think worms). Naturally this means the characters all need rigidbodies, but I’m running into a lot of trouble implementing pathfinding.

Initially, I used a CharacterController to move enemies along their paths, toggling the controller off when the movement was finished. This worked fine, until I saw that enemies would attempt to walk through other enemies and either get stuck or s l o w l y slide around. Since I am using PRO, I tried implementing RVO, but I’ve found that it doesn’t play nice with rigidbodies or colliders.

Right now I’m just updating the graph underneath each enemy when they start and end their moves so they path around each other, but it feels like a waste of the RVO’s potential.

Is there any good way to avoid characters getting stuck on each other while also making use of physics?

Hi

Currently, there is unfortunately no support for using local avoidance and physics. Sorry about that.
The good news is however that I am working on another local avoidance system which I think should be able to work fine with rigidbodies. I will see how it works out though because it is still in a very early stage.

Thanks for the response, I’m looking forward to the new system!

In the meantime, I created a non-pathfinding workaround I am happy with for this particular issue: When a CharacterController runs into a RigidBody, it pops OnControllerColliderHit and either pushes it to the side with force, or asks the blocking character to ‘step-aside’, which does a little animation, moves back slightly and temporarily disables their collider, regaining collision/position at the end of the turn. If it can’t push or request a step-aside, the graph is updated with blocked squares in that location, and the character repaths.

1 Like