Unity Navigation (pathfinding System nav Mesh Agent)

Source: Internet
Author: User


The first kind of simple pathfinding the ground is in contact. Reach the target point without jumping to reach the walk.

A few objects are simply set up in the scene view. 1

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/14/b52307c07c1697dec8e74e4374a1d706.png-wh_500x0-wm_3 -wmp_4-s_611185213.png "title=" image 1.png "alt=" B52307c07c1697dec8e74e4374a1d706.png-wh_ "/>

The capsule body is the seeker, and the yellow ball is the target point. Red flooring, green obstacles.

the floor and obstacles are now selected in the View panel, set the static to Navigation Static 2

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/14/1bd892c0c9a85f652cdfdcfd0d1067db.png-wh_500x0-wm_3 -wmp_4-s_4256022576.png "title=" image 2.png "alt=" 1bd892c0c9a85f652cdfdcfd0d1067db.png-wh_ "/>

then the menu bar selects the window Window –Navigation

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/14/5383dccc4c8e3441b701dac29b6122de.png-wh_500x0-wm_3 -wmp_4-s_1630618543.png "title=" image 3.png "alt=" 5383dccc4c8e3441b701dac29b6122de.png-wh_ "/>

and then select all-Bake baking

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/14/6ea0f670be62b49aeb78f5d2cf0b5e08.png-wh_500x0-wm_3 -wmp_4-s_1857639290.png "title=" image 4.png "alt=" 6ea0f670be62b49aeb78f5d2cf0b5e08.png-wh_ "/>

There are three page parameters to adjust the baking effect, the parameters are specific reference to the Holy Scriptures interpretation.

Note the capsules and objects are baked in a blue lattice. Otherwise, you can adjust the baking size by adjusting the parameters in the second page.

Then add a navigation component to the capsule body

Menu Bar Component-navigation-nav Mesh Agent

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/14/349f04afec044cb9adfba0006f675a47.png-wh_500x0-wm_3 -wmp_4-s_266825957.png "title=" image 5.png "alt=" 349f04afec044cb9adfba0006f675a47.png-wh_ "/>

component parameter details see the Holy Scriptures .

Then add code to the capsule, the contents of the Code

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/14/e168d23e1e6a27fb024568da8f0cd9de.png-wh_500x0-wm_3 -wmp_4-s_3058145571.png "title=" image 6.0.png "alt=" E168d23e1e6a27fb024568da8f0cd9de.png-wh_ "/>

AA is the target. In the Inspector panel, give the ball to AA. Run to achieve simple pathfinding. 650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/14/975913145ce6d7090c15b1325b1c20b8.png-wh_ 500x0-wm_3-wmp_4-s_2332025277.png "title=" image 6.png "alt=" 975913145ce6d7090c15b1325b1c20b8.png-wh_ "/>

The second way of seeking not continuous, you can Jumping the way to find

Set up a simple scene first If the jump must add three springboard strip white board

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/14/4cf5de2bcd433c6ba1d48029369f4eda.png-wh_500x0-wm_3 -wmp_4-s_3364576462.png "title=" image 7.png "alt=" 4cf5de2bcd433c6ba1d48029369f4eda.png-wh_ "/>

set the ground and the plateau (green) together to Navigation Static

add a component to the intermediate springboard Component navigation off Mesh Link    There are several properties  start and end   This is the jump position and the landing position, the two springboard with the mouse to drag on. The capsule body is added as the first type of pathfinding component. Add a script. Script. After all components have been selected finally choose Bake

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/14/e7bded8f365b01bf0c0b10a5b584e732.png-wh_500x0-wm_3 -wmp_4-s_3170088323.png "title=" image 8.png "alt=" E7bded8f365b01bf0c0b10a5b584e732.png-wh_ "/>

when baking all of the following two properties are checked.

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/14/7f7ce35b85098727e4c3b50c32f16f4f.png-wh_500x0-wm_3 -wmp_4-s_1899345377.png "title=" image 9.png "alt=" 7f7ce35b85098727e4c3b50c32f16f4f.png-wh_ "/>

baking sometimes occurs when a circle position is not baked, because the capsule body enters too much ground. The capsule body can then be moved to the blue grid to run. The above steps fall to the next step and the system will not be implemented. you can be careful.

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/14/227a162324974b614fce1175bee59a6b.png-wh_500x0-wm_3 -wmp_4-s_2330541264.png "title=" image 10.png "alt=" 227a162324974b614fce1175bee59a6b.png-wh_ "/>

A Gent RADIUS Proxy radius radius the smaller the area of the resulting mesh, the more it is closer to the edge of the static object.

A Gent Height Agent altitude

Max Slope height of object lifting step

Max drop distance allowed for drop Height

J Maximum allowable jump distance for UMP Height

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/14/6f12281913bac21fe06390df72239942.png-wh_500x0-wm_3 -wmp_4-s_432123792.png "title=" image 11.png "alt=" 6f12281913bac21fe06390df72239942.png-wh_ "/>

RADIUS proxy evasion Radius height agent passes the height of the object below the obstacle

Base Offset Offset distance

S teering Operation Guide

Speed Agent Max Mobile Angular speed angular velocity

Acceleration maximum acceleration stopping the distance between the Distance stop and the target (stop when the target is much)

Auto braking whether the agent automatically brakes to avoid exceeding the destination point

Obstacle avoidance troubleshooting

Quality Quality Priority

path finding paths in search ...

Auto Traverse off Mesh Link does the agent automatically traverse off mesh Links?

The Off-mesh connection is used to connect the navigation grid to disjoint areas. Typically, when this property is set to true, the role should have the ability to pass through or through the connection automatically. However, it can also be set to False when a special control-wise move is required.

Auto Repath automatically update the path (for example, target location change, need to update the path)

Area Mask Region occlusion (agent's action area, where to go.) Default everthing Anywhere)


This article is from the "13233523" blog, please be sure to keep this source http://13243523.blog.51cto.com/13233523/1981714

Unity Navigation (pathfinding System nav Mesh Agent)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.