@Sasha16456
Начинающий разработчик самоучка

Нужна помощь что делать если появилась ошибка CS1061?

Assets/�⠭����/Standard Assets/Characters/ThirdPersonCharacter/Scripts/AICharacterControl.cs(33,27): error CS1061: Type `UnityEngine.AI.NavMeshAgent' does not contain a definition for `remainigDistance' and no extension method `remainigDistance' of type `UnityEngine.AI.NavMeshAgent' could be found. Are you missing an assembly reference?
Вот скрипт:
using System;
using UnityEngine;

namespace UnityStandardAssets.Characters.ThirdPerson
{
[RequireComponent(typeof (UnityEngine.AI.NavMeshAgent))]
[RequireComponent(typeof (ThirdPersonCharacter))]
public class AICharacterControl : MonoBehaviour
{
public UnityEngine.AI.NavMeshAgent agent { get; private set; } // the navmesh agent required for the path finding
public ThirdPersonCharacter character { get; private set; } // the character we are controlling
public Transform target; // target to aim for

public float maxDistance;
private void Start()
{
// get the components on the object we need ( should not be null due to require component so no need to check )
agent = GetComponentInChildren();
character = GetComponent();

agent.updateRotation = false;
agent.updatePosition = true;
}

// Update is called once per frame
private void Update()
{
if (target != null)
if (maxDistance > (Vector3.Distance(target.position, transform.position)))
agent.SetDestination(target.position);

if (agent.remainigDistance > agent.stoppingDistance)
character.Move(agent.desiredVelocity, false, false);
else
character.Move(Vector3.zero, false, false);
}

public void SetTarget(Transform target)
{
this.target = target;
}
}
}
  • Вопрос задан
  • 96 просмотров
Пригласить эксперта
Ответы на вопрос 1
freeExec
@freeExec
Участник OpenStreetMap
Обновить юнити.
Либо вы не используете using UnityEngine.AI;
Ответ написан
Комментировать
Ваш ответ на вопрос

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

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