当前位置:网站首页>Basic use of Unity's navigation and wayfinding system
Basic use of Unity's navigation and wayfinding system
2022-08-10 06:13:00 【Nobel Prize Winner】
Basic use of Unity's navigation and wayfinding system
Navigation: Navigation and Wayfinding
1. Window->AI->Navigation on the menu bar.2. Determine the static objects in the scene (objects that will not undergo Transform changes during the entire game running process), and set them as static objects (check the box in front of static)3. Bake the navigation map (Navmesh), click the Bake option in the Navigation interface, and click the Bake button4. Add the Navmesh Agent component to the object that needs to be navigated and moved, and then add the target point to the component by code //Add a referenceusing UnityEngine.AI;//Get the NavMeshAgent component and specify the target pointpublic Transform target;NavMeshAgent agent;void Start(){// get the componentagent = GetComponent();//set the target pointagent.destination = target.position;} Navigation panel Bake common properties

Agent Radius: Static ObjectThe distance between the shape of the map and the map baking line
Agent Height: The maximum height of the baked map, limiting the scene content in this range to be baked
Max Slope: Bake the maximum angle of the ramp in the map
Step Height: Bake the height limit of each step in the map
Drop Height: Two static objects, the maximum distance from high to low (two objects must have staggered parts in the same vertical plane, one direction, multiple connections)
Jump Distance: The path between the two platforms can be bakedThe maximum clearance of (two platforms must be in the same plane)
NavMeshAgent, NavMeshObstacle, off-Mesh-Links component properties
Refer to the official manual: https://docs.unity3d.com/cn/current/Manual/class-NavMeshAgent.html
边栏推荐
猜你喜欢
随机推荐
(Flutter报错)Cannot run with sound null safety, because the following dependencies
剑指 Offer(第 2 版)7/7 14-17
除砷树脂吸附原理
解析树字符串并输出中序遍历
如何实现网格建造系统
qemu和主机共享磁盘
探究乱码问题的本源:GBK,UTF8,UTF16,UTF8BOM,ASN1之间的关联
STM32F407ZG 串口通信+固定帧头帧尾传输数据帧
51单片机智能蓝牙APP加油站火灾预警安防防控报警监控系统MQ2DHT11
unity守则(随时持续更新\自我总结)
Unity对象池实现
Share a professional TA's "Shader Reference"
mysql分组排序并取各分组前几个数据
剑指 Offer(第 2 版)7/12 18-20
二次元卡通渲染-着色
浅谈游戏中3种常用阴影渲染技术(1):平面阴影
享元模式-缓存池
在Unity中判断游戏物体是否在游戏屏幕范围之内
GC0053-STM32单片机NTC热敏电阻温度采集及控制LCD1602
电路建模的要点








