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 ...
随机推荐
- Vue ElementUI 的使用
简介: 饿了么公司基于vue开的的vue的Ui组件库 1.Element Ui 基于vue pc端的UI框架 2. MintUi 基于vue 移 ...
- DeprecationWarning
当我在导入sklearn这个库的时候,程序抛出了一个丢弃警告,它的意思是在版本更新后imp库已经不用了,用importlib来代替这个库 Warning (from warnings module): ...
- 关于使用echarts走过的坑(同grid多图、多轴系列)
相信大家在工作中,经常会用到echarts,今天我说下我在工作中浪费时间较长的坑 先来看看我的终极需要实现的图吧: 相信以上效果对于常用的小伙伴来说并不困难, 在此我只说option的配置,关于数据, ...
- LINUX新建和增加SWAP分区
我们都知道在安装Linux系统时在分区时可以分配swap分区,而系统安装后(在运行中)如何建立或调整swap分区呢? 在装完Linux系统之后,建立Swap分区有两种方法. 1.新建磁盘分区作为swa ...
- 注意source folder与folder是不同的,避免404错误
在整合ssm框架的时候,程序和配置文件都没写错,tomcat也部署成功了,但在访问的时候一直404,web项目自带的index.jap却能正常访问,一直找不到原因,后来发现建立放配置文件的文件夹con ...
- 嵌入式linux——说明(零)
之前就学习过嵌入式linux,但是那时候并没有完全投入,学习的也不科学系统,没有笔记,也没有自己写很多的代码来练习,所以到现在是基本归零了,现在比较有富裕的时间来系统的学习,从今天开始要克服每一个学习 ...
- 分享自己用的php分页类实例源码
分享一个我自己用着的php分页类实例源码,供大家参考,具体内容如下: <?php /** file: page.class.php 完美分页类 Page */ class Page { priv ...
- mezzanine的breadcrumb
page_menu tag为什么能渲染出当前页的面包屑路径??靠的是request的page对象,要是page的自己或是它的的祖先才渲染,是根据page的属性page.is_current_or_as ...
- 颜色空间的转换系列 (一) ——RGB2XYZ/LAB
http://www.wk78.com/forum.php?mod=forumdisplay&fid=2&page=1 文件在论坛. 然后需要解决一个问题: 我直接复制过来了,自己看吧 ...
- CSS3奇特的渐变示例
渐变 4个维度去理解渐变 线性渐变 径向渐变 新写法 老写法 最后的老写法镜像渐变可能不太准确.其余都完全正确 <!DOCTYPE html> <html> <head& ...