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;
}
}
}
}