@Veb11111

Как исправить ошибки в c#?

Вылезают 2 ошибки.
Вот скрипт:

using System.Collections;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.AI;

public class EnemyController : MonoBehaviour
{
    NavMeshAgent agent;
    public Transform checkpointoint;

    void Start()
    {
        agent = GetComponent<NavMeshAgent>();
        Invoke("move", 5f);
    }

    void move()
    {
        point Point = point.GetComponent<point>();
        checkpointoint = point.getNext();
        agent.destination = checkpointoint.position;
        Invoke("move", 5f);
    }
}

Вот ошибки:

Assets\EnemyController.cs(19,23): error CS0120: An object reference is required for the non-static field, method, or property 'Component.GetComponent<point>()'

Assets\EnemyController.cs(20,26): error CS0120: An object reference is required for the non-static field, method, or property 'point.getNext()'
  • Вопрос задан
  • 96 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы