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 MadTigger · Sep 08, 2014 at 08:11 AM · 2dcollisionrigidbodyspaceship

How is it best to handle multiple layered colliders?

I am building a 2d spaceship game, where the ships have shields. I have the basic colliders set up, but now I am hitting a snag with shields. I'd like to have incoming objects strike the shields (if they are functioning and up), otherwise just strike the ship.

If a ship with shields up bumps into another ship with shields up, I want to have a collision. Currently, the first ship's shield will collide with the second ship, and prevent the second ship's shields from coming into contact with the first ship.

I think I might need to put a 2dRigid body on the ship shields (which is a child of the parent ship) in order to get the shields to respect each other. If I do that, I need to figure out how to turn off the rigid body if/when shields go down for a particular ship.

Does anyone have any suggestions of a better way to 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
0

Answer by Pyrian · Sep 08, 2014 at 06:12 PM

Why don't you just set the shields to collide with each other?

I don't recommend adding a second Rigidbody2D to the same construct if they're never going to move independently. Rigidbodies are not constrained by the parentage, so you'd have to use another method to affix them. Further... I'm not sure what benefit you'd get.

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 MadTigger · Sep 09, 2014 at 03:35 AM 0
Share

I didn't think adding extra rigidbodies sounded like a good idea. I would think that this can be solved with just some colliders.

The circle collider2D don't seem to trigger each other, they only seem to be triggering when they collide with the ship's hull.

Other things I looked at:

I also checked to make sure that the layer that they were on was set respond to collisions with itself.

Both objects are created from the same prefab.

circle collider2D that represents the shield isn't set to be a trigger.

Don't know what else might be causing the missed collision.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Collision between two kinematic rigidbody triggers 2 Answers

2D Smooth Collision, Prevent Player from Clipping Through Wall 1 Answer

Object moves too fast after bouncing off of a moving collider,objects move too fast after bouncing off a moving collider 2 Answers

Rigidbody2D - character jitter on collision 1 Answer

2d collision detecting simultaneous collisions. 1 Answer


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