Build error CS0246: The type or namespace name 'AIPath' Unity 2021.3.20f1

When trying to make a build, it outputs an error… I can’t understand why it can’t find the path to AIPath

using UnityEngine;
using Pathfinding;

public class UnitMovement : MonoBehaviour
{
    private AIPath AI;
    Camera myCam;
    public LayerMask ground;
    private void Awake()
    {
        AI = GetComponent<AIPath>();
    }
    public void Start()
    {
        myCam = Camera.main;
    }

    // Update is called once per frame
    public void Update()
    {   
        if (Input.GetMouseButtonDown(1))
        {
            RaycastHit hit;
            Ray ray = myCam.ScreenPointToRay(Input.mousePosition);

            if(Physics.Raycast(ray, out hit, Mathf.Infinity, ground))
            {
                AI.destination = hit.point;
            }
        }
    }
}

Hi

If you are using .asmdef files, you need to reference all the asmdef files in the AstarPathfindingProject folder.

1 Like