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 ddxv · Oct 29, 2014 at 11:02 AM · c#2dcollidertrigger

Triggers Interacting with Triggers

Hello everybody and good day.

I have a red and green set of ships, that I want to start destroying each other once they enter each other's triggers.

What I have that doesn't work:

Each ship has a PolygonCollider2D, Rigidbody2D, CircleCollider2D (large circle) with trigger checked,

Currently I am trying to use a OnTriggerEnter2D(Collider2D other) to initiate the attack. But am not getting response from OnTriggerEnter2D, could someone point out for me what the correct combination of Rigidbody2D, Colliders2D and triggers should be?

Comment
Add comment · Show 5
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 AlwaysSunny · Oct 29, 2014 at 09:22 AM 0
Share

I'm 90% sure triggers can't be made to raise events from colliding with other triggers. (Not sure if that's what you meant) Also, if a trigger can move, it needs a kinematic Rigidbody attached.

avatar image ddxv · Oct 29, 2014 at 10:56 AM 1
Share

@AlwaysSunny I saw from two other questions, replies that implied Triggers could interact if they also had Rigidbodies attached, but I wasn't sure from the documentation, so perhaps misunderstood. I will look into it more.

Currently the prefabs all have kinematic rigidbodies attached.

I was also thinking perhaps if the CircleCollider2D triggers can't interact with each other, maybe they could interact with PolygonCollider2D as it doesn't have triggers checked, though that is also not currently working.

I have a pretty basic concept of this all, so I imagine I might need to approach my problem in a different manner.

avatar image MrSoad · Oct 29, 2014 at 11:23 AM 0
Share

I used kinematic rigidbody triggers on my lava balls for a volcano I made. When they entered the water, another trigger, I made the hot glow surrounding them (a texture) disable using a trigger event. So yes you can have two triggers interacting with each other.

Just double checked this and it is definitely how I did it, the water trigger is just a normal trigger with no rigidbody, the lava ball is how I said, and the script is just a normal OnTriggerEnter script attached to the lava ball.

You can move a trigger anyway you want to, it is still attached to an object that has a transform...

avatar image AlwaysSunny · Oct 29, 2014 at 12:00 PM 0
Share

$$anonymous$$y bad, guys. Guess I was 90% wrong! That said, I'm quite certain that triggers that move should always have a kinematic rigidbody. It may work without one, and in light-duty cases it won't matter, but performance is improved because of how the physics system handles moving objects.

avatar image MrSoad · Oct 29, 2014 at 12:07 PM 0
Share

Not looked into the performance side of moving triggers without a rigidbody so AlwaysSunny may well be right about that.

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

OnMouseDrag issue, Event System 0 Answers

I can't get 2DCollider to work. 1 Answer

Spike Player Die 0 Answers

OnTriggerEnter Not Working 1 Answer

Trigger not getting GameObject 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