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 /
This question was closed Apr 28, 2013 at 09:04 AM by Fattie for the following reason:

Duplicate Question

avatar image
1
Question by Fattie · Oct 20, 2011 at 07:50 PM · physicsraycastcolliderslayermask

Can you 'layer mask' all physics? (Solved.)

Imagine this situation:

Your scene has 200 everyday colliders of different types.

However it has say 10 "special" colliders, which you only use for certain calculations. Let's say their tag is "VerySpecial"

When you do Raycasting, you can of course easily cast onto only those colliders, using a layer mask, or indeed, you can cast on to all the normal colliders, using a layer mask, or indeed you can cast on to both, as you wish.

However...

If you leave the "VerySpecial" colliders enabled all the time, then, they will interact as part of the physics in the scene.

My current solution: I tediously disable all the VerySpecial colliders at start-up.

Whenever I need to use them in a physics frame, I quickly enable all the VerySpecial colliders, and then do my happy calculations.

Then, I quickly disable all of those VerySpecial colliders once more - and back to the normal flow of time.

Sorry if this is a lame newbie question - what's the solution?

Alternately, is there some way to (at least) disable/enable all my VerySpecial colliders all at once, perhaps by tag? What's the deal?

In short .. how to make the

physics layer completely ignore

one group of colliders? Thanks!

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

  • Sort: 
avatar image
2
Best Answer

Answer by Fattie · Oct 21, 2011 at 05:16 PM

Thanks for everyone's help :-)

I realised this is 100% taken care of by Unity.

It is completely handled by the layer-colllision-model "triangle of tick boxes"....

**http://unity3d.com/support/documentation/Components/Layer%20Based%20Collision%20detection.html
http://unity3d.com/support/documentation/Components/class-PhysicsManager.html**

Hope it helps someone.

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

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

2D Raycast Layer Mask not working 1 Answer

Physics2D, weird layerMask behavior on Linecast, Raycast and OverlapPoint 2 Answers

Raycast not ignoring layer 0 Answers

How do I use layermasks? 9 Answers

Is it possible to allow a raycast to pass through a collider to hit things behind it? 6 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