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 PotatoInsertion · Jun 20, 2014 at 10:56 AM · ontriggerenteroncollisionentercontact.point

Looking for a contact.point alternative with triggers

Hey all,

Working on a game now that works with dragging rigid bodies across the screen. At the moment there are areas where you can't drag the object through them, but you can throw them through. At the moment this works with triggers.

For example, you're holding an object and you try and drag it through one of these areas, but when it hits the trigger area, the object is automatically dropped. So you pick it up again and then 'throw it' through: the object passes through the trigger because you're not currently dragging it and the physics just does all the work.

So, all that is working great.

But now I want to instantiate something at the exact point it hits the trigger, which I can't figure out how to do. I can find the exact contact point with OnCollisionEnter and ContactPoint.point, but then nothing else can pass through it because it's not a trigger anymore. Likewise, I've tried adding the above to the object itself, but it doesn't register the collision as it's hitting a trigger.

Any ideas?

Comment
Add comment · Show 4
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 PouletFrit · Jun 20, 2014 at 12:26 PM 0
Share

When do you want to detect the contact point? Want the object is dragged or when it is thrown?

avatar image Nerevar · Jun 20, 2014 at 03:05 PM 0
Share

$$anonymous$$aybe set onTrigger to false when OnTriggerEnter() is called then Use OnCollisionEnter() or OnCollisionStay() to recover the contact point and reset onTrigger to true?

avatar image Phles · Jun 21, 2014 at 01:37 PM 0
Share

If you want to instantiate something at the point an object hits the trigger, why not just use its position from OnTriggerEnter() if its just entered the trigger it's current position is its point of contact with that trigger.

If the object is small this will work well enough

avatar image PotatoInsertion · Jul 03, 2014 at 08:49 AM 0
Share

Apologies, I was expecting an email alert when someone commented on this, so missed all your comments.

The way I solved it at the end was to add new triggers to each edge of the object being dragged in separate empty game objects. These then fired when i hit the forcefield. Not that elegant, but works fine. Also was handy as I could use the same triggers for sounds for when it was dragged into other things.

While it's a 3D game, everything is dragged and moving along one vertical plane, so that's why this worked well with just a trigger at each end. For something more complex I imagine I'd need a more complex solution.

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

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Character controller collider? 0 Answers

Response speed in OnCollisionEnter / OnTriggerEnter 1 Answer

How to detect collision without OnCollisionEnter or OnTriggerEnter? 1 Answer

OnTriggerEnter2D only one time 1 Answer

How do I use an enemy's OnTriggerEnter to collide with stationary player? 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