• 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
3
Question by Peter B-B · Apr 10, 2010 at 03:08 AM · collisionphysicsrigidbody

physics culling mask?

I want to make my missle not bounce off the player that its shooting from. They're both rigidbodies. How can I do this?

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
Best Answer

Answer by dhendrix · Apr 10, 2010 at 03:24 AM

By using Physics.IgnoreCollision:

var bullet : GameObject = Instantiate (prefab, transform.position , transform.rotation);

Physics.IgnoreCollision(bullet.collider, gameObject.collider);

Hope that helps! If it does, don't forget to accept as your answer!

Comment
Add comment · Show 7 · 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 Peter B-B · Apr 10, 2010 at 03:41 AM 0
Share

Thanks for the response! It works. I'm going to wait a few hours before I accept yours as the right answer in case there's a way to do it using layers. This works for now though!

avatar image dhendrix · Apr 10, 2010 at 03:51 AM 0
Share

Well, there is a way using a script. See this question for details:

http://answers.unity3d.com/questions/4167/how-to-make-colliders-to-react-only-with-one-layer

avatar image Peter B-B · Apr 10, 2010 at 03:54 AM 0
Share

thanks :)

avatar image numberkruncher · Feb 04, 2012 at 08:06 PM 0
Share

@dhendrix Does the following prevent collision calculations between self?

 using UnityEngine;
 using System.Collections;

 public class Static$$anonymous$$ine : $$anonymous$$onoBehaviour {

     void Start() {
         Physics.IgnoreCollision(collider, collider);
     }
     
 }
avatar image Kryptos · Feb 04, 2012 at 09:18 PM 0
Share

There is no such thing as 'collision between self'. An object cannot collide with itself.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

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

Moving a ball around a maze 3 Answers

Rigidbody "hitching" on terrain when it falls onto a slope. 0 Answers

Object Flies into Air Upon Collision, or goes through hill depending on isKinematic settings 1 Answer

How to setup character Collisions? 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