Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • 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
2
Question by Lemesky · Jul 13, 2015 at 12:32 AM · collisionphysicsrigidbodynavmeshfall

Nav Mesh Agent won't fall off the platform?

alt text

I did the Unity tutorial "Survival Shooter" which used Nav Mesh Agents (http://unity3d.com/learn/tutorials/projects/survival-shooter).

Now I'm using tools that I learned to create a different game. Problem is that I can't get the blue cubes with Nav Mesh Agents to fall from my platform. I have tried using the Rigidbody AND the Mesh collider but neither makes it work. The blue cubes stop to a invisble wall, even though there is nothing to stop them from falling (but I guess the baked Nav Mesh somehow makes them stop at the edge).

Is it possible to use Nav Mesh and still use physics to make them fall from the ledge? Idea is that the blue cubes should follow the red cube, but they should be able to pump to one another and fall off the platform.

I also tried to expand the baked Nav Mesh over the platform but with no results; the cubes float in the air...

alt text

navmesh.png (85.9 kB)
blueswontfall.png (103.3 kB)
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
3

Answer by gdg · Apr 17, 2018 at 06:35 AM

Attach a rigidbody with collider to the navmesh agent. Mark the rigidbody as kinematic = true and useGravity = false. When the navmesh agent is supposed to fall, disable the navmesh agent, make the rigidbody isKinematic = false, and add a force to it to push it outside or useGravity = true.

Comment
Add comment · Show 4 · 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 Harinezumi · Apr 17, 2018 at 07:06 AM 0
Share

Exactly, this is the right approach: when the navmesh agent reaches the point where it should fall, disable the navmesh agent, and let physics handle it.

avatar image gdg Harinezumi · Apr 17, 2018 at 07:46 AM 1
Share

I have tried something similar and it works unless the navmesh agent needs to be re-enabled if it does not die of the impact. Then if the agent lands on an area with no navmesh coverage (like the edge) then the agent just warps to the navmesh point directly below. In the OP's case it does not seem to be relevant so this method will be fine. I have added a separate question with this case in $$anonymous$$d as I am looking for a solution to that link

avatar image Harinezumi gdg · Apr 17, 2018 at 08:13 AM 0
Share

Yes, the agent needs to be warped in case it will be re-enabled.
I'm interested in your question, but the link is broken...

Show more comments

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

NavMeshAgent hindered by rigidbody 2 Answers

How may I observe expected physical interactions while using Rigidbody.MoveRotation()? 1 Answer

Collision interpenetration and object getting stuck 1 Answer

How do I "remove/disable" collision? 3 Answers

Camera and mesh not colliding 1 Answer


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