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 buzzanthony · May 01, 2012 at 04:23 AM · triggerobjecteventthroughpass

Trigger Event, Ring Pass thru Rod Object

Hi unitiers,

I am a bit new to unity, and trying to figure out this one question below, tried to spend much time searching on g00gle and other unity forms for possible solutions. But not able to get to a good one.Please help

How to trigger a Event(may be event like debug log msg) , when a Ring (Object) going through a Rod(Object)?

Thanks in advance. buzzanthony.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Seth-Bergman · May 01, 2012 at 06:48 AM

Here's what I'm envisioning:

alt text

the colliders pictured would only be used for the trigger/collision function, and should only be able to connect if the rod goes through


sampleRingRod.jpg (58.8 kB)
Comment
Add comment · Show 2 · 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 buzzanthony · May 01, 2012 at 07:33 AM 0
Share

Seth,

I did as mentioned, played around for while, got it working , Superb !!

Thanks alot.

avatar image Seth-Bergman · May 01, 2012 at 07:35 AM 0
Share

glad I could help!

PS don't forget to thumbs up an answer if it helps!

avatar image
0

Answer by Seth-Bergman · May 01, 2012 at 05:24 AM

Not much info to go on, it would help to be specific.. At any rate, you probably want to us a trigger of some kind. If your objects both have a collider on them, you can check "isTrigger" on one of them, and when they come into contact a trigger signal is sent. You can access it in the OnTriggerEnter function, like:

 function OnTriggerEnter(other : Collider)
 {
 //code to do whatever
 Debug.Log("activated trigger");
 }

if you can be more specific, maybe I could help better

Comment
Add comment · Show 3 · 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 Seth-Bergman · May 01, 2012 at 05:57 AM 0
Share

further, if I understand correctly.. I imagine if you were to hide a small box collider inside the mesh of the rod, and another in the center of the ring, then the two could only meet when the rod passed through

avatar image buzzanthony · May 01, 2012 at 06:18 AM 0
Share

Thanks Seth,

Some info : Both objects had colliers proprieties and have rigid body.

Requirement : unless or until the ring goes thru the rod, the trigger needs to be enabled.

The script mention would if collides itself.

Thanks Again.

avatar image Seth-Bergman · May 01, 2012 at 06:31 AM 0
Share

again, if I'm getting this correctly.. you can create an empty game object, child it to the rod, then add a box collider to it. The collider on the rod itself will handle the physics, while the second childed box collider will act as the trigger. if this second collider is entirely inside the mesh of the rod, it can only be triggered by passing through the ring (provided there is a collider in the center of the ring)..

avatar image
0

Answer by buzzanthony · May 01, 2012 at 05:12 PM

it allows to only mark it as correct answer , when trying to thumbs up says

"You don't have permission to do this action. Please Login as another user"

anyway thx.

Comment
Add comment · Show 2 · 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 fafase · May 01, 2012 at 05:13 PM 0
Share

Because your only have 2 of karma, you need 15 $$anonymous$$imum

avatar image Seth-Bergman · May 01, 2012 at 05:15 PM 0
Share

that's all I meant, thanks. Also, try to click "add new comment" for comments like this, rather than creating a new answer.

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

Creating objects when entering a trigger? 1 Answer

create event on collision 2 Answers

Find object that enters trigger 1 Answer

Detecting another object collision from another object script (2D) 0 Answers

How would I detect a right click with an event trigger? 3 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