• 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 /
  • Help Room /
avatar image
1
Question by dubstaphone · Sep 12, 2015 at 05:57 PM · c#aipathfindingastar

How do I make AI objects not walk on top of each other?

In this screenshot, you can see that all of the AI objects are happily doing their thing. However... ...in this screenshot, they are on top of each other. This happens when they reach their destination, and for some reason gravity will not work for them, so they can't fall down. What is causing this, and how can I stop it?

Thanks! P.S. I'm using the A* Unity Pathfinding Project for the AI.

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

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by BowlerBitesLane · Sep 12, 2015 at 07:13 PM

Have you tried adjusting the stopping distance of the NavMeshAgent components of the characters?

http://docs.unity3d.com/ScriptReference/NavMeshAgent-stoppingDistance.html

If that's not enough, you could add a script component that uses the onTriggerEnter method that will GetComponent(NavMeshAgent).Stop() when it detects a collision with another navmeshagent gameObject collider.

http://docs.unity3d.com/ScriptReference/NavMeshAgent.Stop.html

Comment
Add comment · Show 1 · 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 dubstaphone · Sep 12, 2015 at 08:44 PM 0
Share

This seems to work a LITTLE better, but they still climb on top of each other to avoid each other. EDIT: Just realized this doesn't work at all, because I'm not using navmeshes. I'm using the AStar pathfinding project's components.

avatar image
0

Answer by alvarosaavedra · Jan 14, 2016 at 04:39 PM

Hi @dubstaphone,

I have the same issue, did you solve it? I've been trying changing Rigidbody values (Mass, Drag, Angular Drag) but nothing. I hope you can help me somehow.

Thank you!

Comment
Add comment · 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
0

Answer by Polo44 · Oct 29, 2016 at 12:32 PM

Try changing character controller' Steop offset to 1

Comment
Add comment · 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
0

Answer by HotActionGames · Dec 14, 2016 at 03:58 AM

Unity is very poor in this regard, best to get rid of physics interactions between moving objects altogether and do your own, you can try all things everyone suggests and believe me, nothing will work, you should just use Triggers and Raycasts and put them on layers that don't react to each other on the built in physics

Comment
Add comment · Show 1 · 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 HotActionGames · Dec 14, 2016 at 04:07 AM 1
Share

ps if you change Step Offset to 0 that will stop it but then the character won't climb anything!

avatar image
0

Answer by smoki99 · Jan 09, 2017 at 06:30 AM

For me worked to lower the "Slope Limit" stopping the "character Controllers" to climb on each other.

Sometimes you also have to increase the "Capsule Collider".

Comment
Add comment · 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

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

8 People are following this question.

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

Related Questions

Enemy AI using pathfinding to avoid obstacles 1 Answer

How do I make my A* script work with prefab enemies and make enemies move using the list created through A*? 0 Answers

Navmesh path to best of several destinations 0 Answers

A* all nodes within range 0 Answers

How to know which point that AI picked to move to? (A* Pathfinding) 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges