Assets/FollowDestination.cs(6,13): error CS0246: The type or namespace name `NavMeshAgent' could not be found. Are you missing `UnityEngine.AI' using directive?的解决方案
问题的出现与描述
在Unity中创建一个NPC,使它一直跟踪一个目标Destination,C#脚本代码如下,错误信息描述如下
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class FollowDestination : MonoBehaviour {
private NavMeshAgent ThisAgent = null;
public Transform Destination = null; void Awake()
{
ThisAgent = GetComponent<NavMeshAgent>();
}
// Use this for initialization
void Start () { } // Update is called once per frame
void Update () {
ThisAgent.SetDestination(Destination.position);
}
}

解决方案
根据提示信息我知道原因是 “缺失的是引用UnityEngine.AI命名空间的指令 ”,所以我们要在FollowDestination.cs 中加上 using
UnityEngine.AI。

Assets/FollowDestination.cs(6,13): error CS0246: The type or namespace name `NavMeshAgent' could not be found. Are you missing `UnityEngine.AI' using directive?的解决方案的更多相关文章
- [virsh] error: unknown OS type hvm解决办法
今天在linux服务器上编译安装升级了下qemu,升级命令如下: root@ubuntu:/opt/qemu-# ./configure --prefix=/usr/local/ --target-l ...
- ASP.NET MVC 提示there was error getting the type的解决方法
在MVC中根据模型类创建控制器时提示there was error getting the type的原因是你新建的这个类模型文件后没有重新生成,先重新生成项目就可以添加控制器了.
- jersey处理支付宝异步回调通知的问题:java.lang.IllegalArgumentException: Error parsing media type 'application/x-www-form-urlencoded; text/html; charset=UTF-8'
tcpflow以流为单位分析请求内容,非常适合服务器端接口类服务查问题 这次遇到的问题跟支付宝支付后的回调post结果有关 淘宝的代码例子: public void doPost(HttpServle ...
- Ubuntu urllib2.URLError:<urlopen error unknown url type:https>
描述: python中urllib2 下载网页时,出现错误urllib2.URLError:<urlopen error unknown url type:https> 解决方法: pyt ...
- Solve Error: 'has incomplete type', foward declaration of 'class x'
在C++的OOB编程中,有时候我们会遇到这样的错误Error: 'has incomplete type',forward declaration of 'class x',那么是什么原因引起的这个问 ...
- scala 2.11报错error: not found: type Application
FROM: http://j-q-j.org/scala/scala-2-11-application-error.html 这两天学习scala,官网下载的最新版本2.11,书用的是<Prog ...
- error: unkown OS type hvm 解决方法 kvm libvirtd 重新加载已有虚拟机信息
想验证下最新版本的qemu的一些功能,于是将其从qemu-0.12升级到了qemu-1.4,编译安装一切都很顺利,但是当创建virtual machine时,报错如下: [root@compute-- ...
- {"timestamp":"2019-11-12T02:39:28.949+0000","status":415,"error":"Unsupported Media Type","message":"Content type 'text/plain;charset=UTF-8' not supported","path":&quo
在Jmeter运行http请求时报错: {"timestamp":"2019-11-12T02:39:28.949+0000","status&quo ...
- 安装mysql 初始化的时候报错 Can't find file: './mysql/db.frm' (errno: 13) ERROR: 1017
目录下没有权限 需要权限
随机推荐
- 关于https中的算法
1,对称加密算法,是指加密和解密使用相同的密钥,典型的算法有RSA,DSA,DH 2,非对称加密算法:又称为公钥加密算法,是指加密和解密使用不同的密钥,公共的公钥用于加密,私钥用于解密,比如第一次请求 ...
- flink-jdbc sink
https://github.com/apache/flink/tree/master/flink-connectors/flink-jdbc/src https://blog.csdn.net/lu ...
- JAVA CAS原理深度分析 volatile,偏向锁,轻量级锁
JAVA CAS原理深度分析 http://blog.csdn.net/hsuxu/article/details/9467651 偏向锁,轻量级锁 https://blog.csdn.net/zqz ...
- Linux设备驱动开发详解
Linux设备驱动开发详解 http://download.csdn.net/detail/wuyouzi067/9581380
- 谷歌Chrome浏览器小于12px字号显示的BUG
webkit的私有属性:html{-webkit-text-size-adjust:none;}
- django创建应用
创建应用--在一个项目中可以创建多个应用,每个应用进行一种业务处理 打开CMD,进入project(目录名)的目录下,输入命令创建名为myApp的app: python manage.py start ...
- Android基础——Fragment与Activity交互
今天继续讲解Fragment组件的特性,主要是跟Activity的交互和生命周期的关系,我们前面已经说过Fragment是依赖于Activity的,而且生命周期也跟Activity绑定一起.下面我们看 ...
- Android 桌面Widget开发要点(时间日期Widget)
最近需要编写一个日期时间的桌面Widget用来关联日历程序,以前很少写桌面Widget.对这方面技术不是很熟悉,今天花时间重新整理了一下,顺便把编写一个简单时间日期程序过程记录下来. 桌面Widget ...
- 在IIS中访问APS页面时提示:“最可能的原因使用的托管的处理程序,但是未安装或未完整安装asp.net“
打开CMD窗口,执行下面的命令: "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -iru -ena ...
- python学习笔记十四:wxPython Demo
一.简介 wxPython是Python语言的一套优秀的GUI图形库,允许Python程序员很方便的创建完整的.功能键全的GUI用户界面. wxPython是作为优秀的跨平台GUI库wxWidgets ...