A Star Pathfinding not being recognised in Visual studio after working at first.

Suddenly got an issue where Using Pathfinding isn’t coming up with an error but Private Path path; and Seeker seeker; are throwing errors saying they don’t exist. The code that uses this work in game but if I removed the code from the game object it won’t let me add it back on due to the errors. Help!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;

public class EnemySuiciderAI : MonoBehaviour
{
    public Transform[] targets;
    public float speed = 200f;
    public float nextWaypointDistance = 3f;

    public Transform enemyGFX;

    private Path path;
    private int currentWaypoint = 0;
    private bool reachedEndOfPath = false;

    private int targetCount = 0;
    Seeker seeker;
    Rigidbody2D rb;
    private Transform target;

    // Start is called before the first frame update
    void Start()
    {
        seeker = GetComponent<Seeker>();
        rb = GetComponent<Rigidbody2D>();

        InvokeRepeating("UpdatePath", 0f, 0.5f);
    }

Having the same issue. Did you find a solution?

Are you running Unity 2019.3.13 or thereabouts? There was a bug in a recent Unity version that caused this.
I think it’s fine on latest Unity version.

1 Like

We are using 2019.3.12. Should we update?

Edit: Updated to 2019.3.15, this fixed the issue, THANK YOU.

1 Like

Yes, I think that will solve your problem. It’s discussed here:
https://forum.arongranberg.com/t/compilation-errors-with-version-4-2-15-and-unity-2019-3-12f1/8639

(As always, ensure your project is fully backed up before updating!)

Is anyone else having this issue in 2021? Starting getting this same problem but updating Unity is not helping :frowning:

1 Like

bump, same here. “using Pathfinding” doesn’t seem to be doing anything.