- Home /
C# detecting point of collision
When my character's box collider collides with something else, I need to be able to know which side of the box is being touched for the character's script. My work around solution has been to attach four edge colliders (arranged in a square) to the character via separate game objects & have them communicate with the character's script via static booleans or static list. But as you can imagine, applying this workaround to all the other objects in the game world eventually causes the game to lag.
Is there a way to get each edge collider object to interact with only their parent's script without using a static list, or is there a function of box colliders that allow you to know which side collided that I'm just completely unaware of? I've looked around & found links for Collision.contacts as well as ContactPoint.point in the docs but both links are dead... or at least aren't pulling up for me. As always, any help is much appreciated :3
Collision.contacts and ContactPoint.point is what you are looking for. I think there is something going on with unity's server tonight cause i was having problems pulling up some APIs too. try the links again later.
Your answer
Follow this Question
Related Questions
Object passes through collider even when isTrigger is turned off. 2 Answers
NavMesh Collision Detection? 0 Answers
Collision Dection on Tigger Enter 1 Answer
Best collision detection method? 2 Answers