• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Horschty · Oct 29, 2017 at 03:54 PM · navmeshnavmeshagentpathfinding

NavMeshAgent calculated path going in a straight line ignoring height in between start and end

I'm trying to use the NavMesh system to calculate the path only and then move my objects manually along that path. I'm doing this by disabling the automatic updates of position, rotation, upaxis and setting obstacle avoidance to none, then setting agent.nextPosition to the start position and calculating the path using agent.calculatePath with the destination. Then I get my array of points that make up the path like I want. The problem is, it completely ignores height and goes straight through humps or over valleys in a straight line. But I can walk on top of a mountain if I set the destination to be there, it just goes in a straight line up instead of curved. Why? What am I missing?

Edit: Here is a video to illustrate the problem (ignore the colorful balls :) ) https://youtu.be/6BpqtjzOzEs

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by finlay_morrison · Oct 29, 2017 at 05:21 PM

Did you set a max step height and slope angle before baking the navmesh?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Horschty · Oct 29, 2017 at 05:50 PM 0
Share

I left it at the defaults, 0.5 step height, 45° angle. Also tried modifying it but no difference. (Re-baking after every change). Why is there a seperate "Baked Agent Size" on the Bake Tab after already defining a named one in the Agents Tab? I set both to the same values.

avatar image Cahir Horschty · Jan 19, 2018 at 02:11 PM 0
Share

Did you find a solution for this problem?

avatar image Horschty Cahir · Feb 11, 2018 at 05:03 PM 0
Share

Sorry for the late answer, the e-mail notification landed in my spam folder which I rarely check. No, I didn't find a solution but I found a workaround by doing a raycast down from the player, to find the Y coordinate of the ground at the players "feet" and then place the Y coordinate of the player there manually. Sadly no real 3D pathfinding.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

77 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Put (Instantiate) Gameobject along or accross a path Unity 1 Answer

Navmeshagents slowing down when going around edges 1 Answer

Navmesh Agent avoidance with as triggers 1 Answer

Issue with NavMeshAgent behavior in 4.2 1 Answer

NavMeshAgent Different Sizes Help 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges