当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
STM32F407ZG 看门狗 IWDG & WWDG
【接口自动化】
优先级队列,大小顶堆PriorityQueue
在Unity中利用代码动态更改场景中的天空盒
浅谈游戏中3种常用阴影渲染技术(2):阴影锥
Unity屏幕坐标转世界坐标,鼠标点击获取三维位置
新建STM32F407ZG Keil5项目
markdown类图学习
21天学习挑战赛--分班
【C语言】结构体变量学习笔记1
氨氮吸附工艺
一小时极速掌握游戏资源远程热更新
Unity中暂停、继续播放、杀死、正放、倒放Dotween动画
51单片机智能蓝牙APP加油站火灾预警安防防控报警监控系统MQ2DHT11
51单片机手动自动智能窗户窗帘控制系统手动自动定时
C#热更新比Lua好在哪里?
51单片机ST188手持人体温度脉搏心率测量仪锂电池充电
屏幕后期处理之:Sobel算子实现边缘检测
Gradle学习 (一) 入门
2021-04-15 jacoco代码覆盖率统计和白盒测试









