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 ...
随机推荐
- C语言排序算法学习笔记——交换类排序
交换类排序:根据序列中两个元素关键字的比较结果来交换他俩在序列中的位置. 冒泡排序:假设待排序表长为n,从后往前(或从前往后)两两比较相邻元素的值,若为逆序(即A[i-1]>A[i])则交换他们 ...
- python 常用技巧
一.字符串与数值的转换 Python中字符串转换为数值: str_num = '99' num = int(str_num) 整型数转换为字符串: num = 99 str_num = str(num ...
- node_api学习之http
node模块学习-http 理解 HTTP构建于TCP之上,属于应用层协议,继承自tcp服务器(net模块),它能与多个客户端保持连接,由于基于事件驱动,并不为每个连接创建额外的进程或线程,所以能实现 ...
- C# VS2017的.net Core1.0项目在版本升级为2.0后找不到程序集的处理办法
最近不小心升级了VS2017,然后原来的.net web core1.0的项目是引用了DataBaseLib的程序集,如图 ,升级之后安装了2.0的框架,发现项目就报错了,,这个是还是之后报的错误, ...
- n2n网络穿透内网
目录 前言 配置 网络拓扑: 公网服务器的配置 公司电脑的配置 家里笔记本的配置 注意事项 使用n2n网络 n2n的各edge之间传输数据 补充:NAT类型 后记 前言 在家里的时候比较经常需要对公司 ...
- echarts统计图Y轴(或X轴)文字过长问题解决
echarts 统计图Y轴文字过长 在使用echarts时,出现数值非常大,Y轴又显示不下的情况就需要压缩Y轴数值刻度. 解决方法: yAxis: { type: 'value', axisLabel ...
- ef err
InvalidCastException: The field of type jcz.DomainModels.Sex must be a string, array or ICollection ...
- Golang 包管理简介
Golang 包管理 在一个项目里,如果想引用本地包,经常会把新手搞的莫名其妙.这里通俗记录一下. 首先先要知道几个默认的规则 必须定义环境变量GOPATH,GOPATH可以定义多个目录 所有项目代码 ...
- Echarts属性大全(及时更新最新信息)
echarts属性的设置(完整大全) // 全图默认背景 // backgroundColor: ‘rgba(0,0,0,0)’, // 默认色板 color: ['#ff7f50','#87c ...
- [Linux]Ubuntu与终端破墙
参考:https://www.jianshu.com/p/941bf811f9c2 亲测在ubuntu-14.04.4-desktop-amd64.iso上安装成功 福利:https://github ...