A* Pathfinding Project

Rigidbody and APP


#1

Situation: I have an agent with a rigidbody, moving on a recast graph to diffrent positions. The agent can only move in X and Z axes and can’t rotate. The agent has to respond to external forces that add forces to the rigidbody (for example explosions that knock him aside).

How can I make the RichAI movement script work with a Rigidbody that receives external forces? I want the agent to still try to reach a destination, while getting knocked around from explosions.


#2

Hi

I’m not sure if this will work, but what you could try is to, at the start of the MovementUpdateInternal method in the RichAI script, add the line

velocity2D = movementPlane.ToPlane(rigid.velocity);