Search code examples
unity-game-enginevectorgame-physicsunity3d-2dtools

How to get normal vector of the object hitting while using OnTriggerEnter?


When I use OnTriggerEnter method it doesn't return normal vector of the collider i'm hitting. If I would use OnCollisionEnter it can do so as far as i know. But i need to work with triggers not collisions, so I need a way to read the normal of the trigger collider that was hit. Is it possible in any ways? I tried to work with bounds of the collider but didn't get too far.

p.s. I'm interested in 3d physics and in 2d also. Any variant would be welcome. p.p.s. it's Unity3d


Solution

  • There is a Collision Action Chart in the Unity Manual under Colliders. This will tell you what messages can be detected between different setups of objects.