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