hi im new and i keep getting this error "'Path' is a type but is used like a variable" this is the c

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

public class enemy_AI : MonoBehaviour
{

public Transform target;

public float speed = 200f;
public float nextWaypointDistance = 3f;

Path path;
float currentWaypoint = 0f;
bool reachedEndOfPath = false;

Seeker seeker;
Rigidbody2D rb;

void Start()
{
seeker = GetComponent();
rb = GetComponent();

seeker.StartPath(rb.position, target.position, OnPathComplete);
}

void OnPathComplete(Path p)
{
if (!p.error)
{
Path = p;
currentWaypoint = 0f;
}
}

void Update()
{

}
}

Please use code tags.

I’m guessing you have a capitalization error somewhere, where you meant to write “path” but instead wrote “Path”.

1 Like

you can’t do this. apply what Antistone said, because C# is a case-sensitive language.
and learn to use code tags so we can read your code.

1 Like