I’m in the process of migrating Unity’s pathfinding solution to A* Pathfinding Project. I’m using a Recast graph and FollowerEntities. I need to know if an agent (FollowerEntity) is grounded and snapped to the Recast graph, but I can’t seem to find any pulbic FollowerEntity properties that would satisfy this requirement.
This you can check with ai.hasPath. It is always snapped to the navmesh as long as it has a path.
There’s no exposed property for this at the moment, but you could probably do something like this:
var entityManager = ai.world.entityManager;
var closestOnNavmesh = entityManager.GetComponentData<MovementState>(ai.entity).closestOnNavmesh;
if (Mathf.Abs(closestOnNavmesh.y - ai.position.y) > 0.05) {
// Not grounded
}