Support Forum

2D local avoidance gets stuck on world objects?

Hi!
The 2D local avoidance works great in isolation, but when agents use it near world objects (eg. terrain with a collider) they get stuck on the ground. Am I missing something?

I’ve made my movement script based on the documentation: Custom Local Avoidance Movement Script - A* Pathfinding Project

    private void PathfindingUpdate() {
        if (path == null) return;

        if (currentWaypoint >= path.vectorPath.Count) {
            reachedEndOfPath = true;
            return;
        }
        else {
            reachedEndOfPath = false;
        }

        
        if (stateMachine.ActiveState.name == "Idle") {
            avoidanceController.SetTarget(path.vectorPath[currentWaypoint], patrollingSpeed, patrollingSpeed * 2);
            Vector3 delta = avoidanceController.CalculateMovementDelta(transform.position, Time.deltaTime);
            body.AddForce(delta * patrollingSpeed, ForceMode2D.Force);
        }
        else {
            avoidanceController.SetTarget(path.vectorPath[currentWaypoint], moveSpeed, moveSpeed * 2);
            Vector3 delta = avoidanceController.CalculateMovementDelta(transform.position, Time.deltaTime);
            body.AddForce(delta * moveSpeed, ForceMode2D.Force);
        }

        float distance = Vector2.Distance(body.position, path.vectorPath[currentWaypoint]);
        if (distance < nextWaypointDistance) {
            currentWaypoint++;
        }
    }

The agents touching the “ground” here are stuck:

I can’t post more than 2 pictures, so RVO Simulator settings:
FPS: 10
Plane: XY
Threads: Two
Symmetry: 0.1

Hi

Which version of the package are you using?

4.2.18

asdasdasdasdasdasdasdasda(character limit)