Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Rigidbody necessary to use collision detection 1 Answer

Nav Mesh Agent won't fall off the platform? 1 Answer

Character rigidbody collisions 1 Answer

Collision between player and a ball 1 Answer

Camera gets flung off of the map when the player collides with certain objects. 0 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