Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by RaulG · Feb 06, 2015 at 04:24 AM · collisionphysicsrigidbody

Ignore collision with self?

 Physics.IgnoreCollision(this.gameObject.rigidbody.collider, this.gameObject.rigidbody.collider);


Tried using that, but it doesn't like being used against itself..

So is there another way to ignore collision with self?

Comment
Add comment · Show 1
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 Scribe · Feb 06, 2015 at 05:12 PM 0
Share

colliders dont collide with themselves, else you would get a OnTriggerStay call every frame, which you dont.

What is your intended behaviour and what is happening now that you are trying to fix.

1 Reply

· Add your reply
  • Sort: 
avatar image
4

Answer by alok-kr-029 · Feb 06, 2015 at 04:41 AM

The best way to do it is assign a specific layer to the game objects and use collision matrix table to ignore the collision between the layers edit->Project settings -> Physics- > collision Matrix

Comment
Add comment · Show 8 · 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 RaulG · Feb 06, 2015 at 04:57 AM 0
Share

But it's with a single object, not two different ones.

So how would that work with a single object?

avatar image Umresh · Feb 06, 2015 at 05:59 AM 0
Share

Add that game object to a new layer and change the collision settings in Physics setting. Objects in this layer will ignore collision.

avatar image alok-kr-029 · Feb 06, 2015 at 06:46 AM 0
Share

It will work for any number of game object with same layer

avatar image RaulG · Feb 06, 2015 at 06:53 AM 0
Share

For some reason the objects don't get any force when I try to disable the collision..

avatar image RaulG · Feb 06, 2015 at 07:27 AM 1
Share
 public float waitfordecollider = 0.0f;
 
 
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () 
     {
         waitfordecollider += Time.deltaTime;
 
         if(waitfordecollider >= 0.1f)
         {
             collider.isTrigger =true;
             waitfordecollider = 0.0f;
         }
     }


So I did something, I don't know what, but whenever I set my object to not collide with itself, it refuses to work with Rigidbody.Forcemode or anything like that.

So I switched to setting it to a trigger after .1 seconds, which has somewhat the same effect. Im just wondering if this can become an issue performance wise?

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

21 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

Related Questions

Rigidbodies won't collide if mass difference is too high 0 Answers

Character Controller meets Rigidbody 1 Answer

How to get collisions on Character controller? 1 Answer

Rigidbody.MovePosition/MoveRotation Hits far away colliders 2 Answers

Is there a solution to when colliders bypass? 2 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