Hi folks, I've got a basic understanding of collisions, but what I want to know is this:
Can I make an object pass through another, but still have OnCollisionEnter called?
Answer by andrew
Jul 15, 2010 at 11:47 AM
it sounds like what you want are trigger events. You need to set your Collider to 'isTrigger = true' (either via the check box in the collider component or via scripting).
Then they won't actually call Collision events, but rather 'trigger' events when another object passes through them. (eg OnTriggerEnter, OnTriggerExit and OnTriggerStay)
That's brilliant thanks, worked a treat
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
OnCollisionEnter inside FixedUpdate?
OnCollisionEnter called once even with multiple contacts
Changing transform.localScale but OnCollisionEnter isn't executed
OnCollisionEnter event seems to be called late.
FIXED: How can I stop a collider from tunneling?