Failed to create agent because it is not close enough to the NavMesh
主要原因是:两个相同对象navmesh点太近造成。
解决方案:通过NavMesh.SamplePosition 获得可以行走点
for(int i = ;i<;i++)
{
float fRadius = Random.Range(, mRadius);
float fAngle = Random.Range(, 3.14f); Vector3 v3 = mStartPos;
v3.x += Mathf.Sin(fAngle) * fRadius;
v3.z += Mathf.Cos(fAngle) * fRadius; NavMeshHit hit;
if(NavMesh.SamplePosition(v3, out hit, mRadius, ))
{
GameObject p = Instantiate<GameObject>(mCat, hit.position, Quaternion.identity, transform);
if (p != null)
{
NavMeshAgent agent = p.AddComponent<NavMeshAgent>();
if(agent!=null)
{
agent.speed = 5.0f;
}
mCatList.Add(p);
}
} }
Failed to create agent because it is not close enough to the NavMesh的更多相关文章
- Failed to create AppDomain 'xxx'. Exception has been Failed to create AppDomain
一服务器上的数据库全部被置于紧急模式(EMERGENCY),在错误日志里面能看到大量下面的错误 Failed to create AppDomain "YourSQLDba.dbo[runt ...
- build.fxbuild打不开 Failed to create the part's controls
Failed to create the part's controls 以文本形式打开之后,发现编码的地方不是常用编码 将之修改为GBK 然后就可以正常打开了 最后把eclipse中的编码统一设置为 ...
- pip/easy_install failure: failed to create process
使用pip install requests安装requests, 报错: failed to create process 解决方法: 执行Python -m pip install --upgra ...
- 运行easy_install安装python相关程序时提示failed to create process
运行easy_install安装python相关程序时提示failed to create process,因为安装了两个python,卸载了的那个目录没删除,删除了另外的python目录后这个问题就 ...
- Failed to create the Java Virtual Machine.问题的解决
运行Eclipse,出现了"Failed to create the Java Virtual Machine."错误: 解决的办法是在Eclipse的解压目录下找到eclipse ...
- eclipse failed to create the java virtual machine 问题图文解析
eclipse failed to create the java virtual machine 问题图文解析 分类: java常用软件异常2010-10-02 23:45 73200人阅读 评论( ...
- Failed to create the part's controls [eclipse]
查看源码 出现 Failed to create the part's controls 解决方法: eclipse.ini 中添加: -startup plugins/org.eclipse.eq ...
- android studio 开启genymotion 出现"failed to create framebuffer image"
出现错误 Unable to start the virtul device To start virtual devices, make sure that your video card supp ...
- AX2012 R3 Data upgrade checklist sync database step, failed to create a session;
最近在做AX2012 R3 CU9 到CU11的upgrade时 (用的Admin帐号), 在Date upgrade 的 synchronize database 这步 跑了一半,报出错误 说“fa ...
随机推荐
- 贝叶斯、朴素贝叶斯及调用spark官网 mllib NavieBayes示例
贝叶斯法则 机器学习的任务:在给定训练数据A时,确定假设空间B中的最佳假设. 最佳假设:一种方法是把它定义为在给定数据A以及B中不同假设的先验概率的有关知识下的最可能假设 贝叶斯理论提供了 ...
- PackagesNotFoundError: The following packages are not available from current channels
因为要用到lifelines 包,在cmd中使用conda install lifelines ,显示如下错误: PackagesNotFoundError: The following packag ...
- Android 开发 ConstraintLayout详解
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' app:layout_constraintHorizo ...
- gentoo annie youku video
在gentoo 上面,如果需要下载 youku 的视频的话,可以使用 annie 这个软件来下载.annie 软件主页:https://github.com/iawia002/annie#instal ...
- 【perl】simpleHTTP
类似Python SimpleHTTPServer #!/usr/bin/perl # https://metacpan.org/pod/HTTP::Server::Simple # https:// ...
- Django整理1
基本结构 │ db.sqlite3 ----------sqlie3数据库 │ manage.py │ ├─logres │ │ admin.py 后台,可以用很少量的代码就拥有一个强大的后台. │ ...
- Kafka(1)--kafka基础知识
Kafka 的简介: Kafka 是一款分布式消息发布和订阅系统,具有高性能.高吞吐量的特点而被广泛应用与大数据传输场景.它是由 LinkedIn 公司开发,使用 Scala 语言编写,之后成为 Ap ...
- python学习(二)--数据类型
数据类型 1.工厂函数 type() int() float() str() list() tuple() dict() bool() set()工厂函数的理解:工厂函数看上去有点像函数,实质上他们是 ...
- JAVA版本微信管家平台—JeeWx 捷微 4.1 微服务版本发布,微信砍价活动闪亮登场!
捷微 4.1 微服务版本发布,微信砍价活动闪亮登场 ^_^ JEEWX 从4.0版本开始,技术架构全新换代更名 “捷微H5”.这是一款开源免费的微信运营平台,是jeewx的新一代产品,平台涵盖了: ...
- API & Web API
The follow content refer refers to: Baidu Baike : https://baike.baidu.com/item/api/ ...