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
目录下没有权限 需要权限
随机推荐
- 通过ip查找能应机器的MAC
例如:10.100.0.61 这些都是基于linux系统: 首先:ping 一下这个ip 然后arp 10.100.0.61就可以找出主机的MAC地址
- 制做rpm包工具fpm安装
安装ruby模块 [root@c01 ~]# yum install ruby rubygems ruby-devel -y # 查看当前使用的rubygems仓库 [root@c01 ~]# gem ...
- 【MySQL】MySQL层级数据的递归遍历
层级的业务数据在系统中很常见,如组织机构.商品品类等. 如果要获取层级数据的全路径,除了缓存起来,就是递归访问的方式了: 将层级数据缓存在redis中,用redis递归获取层级结构.此方法效率高. 在 ...
- python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool
报错信息 Traceback (most recent call last): File "<stdin>", line 1, in <module> Fi ...
- SVN如何切换账号
https://www.cnblogs.com/six-moon/p/5233878.html **************************************************** ...
- C# winform打包(带数据库安装)<转>
使用VS自带的打包工具,制作winform安装项目 开发环境:VS2008 Access 操作系统:Windows XP 开发语言:C# 项目名称:**管理系统 步骤: 1.打开开发环境VS2010, ...
- 5. EM算法-高斯混合模型GMM+Lasso
1. EM算法-数学基础 2. EM算法-原理详解 3. EM算法-高斯混合模型GMM 4. EM算法-GMM代码实现 5. EM算法-高斯混合模型+Lasso 1. 前言 前面几篇博文对EM算法和G ...
- iOS微信实现第三方登录的方法
这篇文章主要介绍了iOS微信第三方登录实现的全过程,一步一步告诉大家iOS微信实现第三方登录的方法,感兴趣的小伙伴们可以参考一下 一.接入微信第三方登录准备工作.移动应用微信登录是基于OAuth2 ...
- <第一次买基金就赚钱>读书笔记
基金,是指专门用于某种特定目的的并进行独立核算的资金 基金的开放日指基金契约规定的投资者可以在销售网点办理基金申购.赎回交易业务的日期 基金资产总值是指一个基金所拥有的资产(包括现金.股票.债券和其他 ...
- mac上怎么安装dmg
双击dmg文件,就会打开了,里面一般就是应用程序,拖到Finder-应用程序(如果里面是pkg格式,就是安装包,双击安装),然后还要注意一个安装完了以后,要把刚才载入的dmg推出,方法是把桌面上那个图 ...