# Getting collision normal of own collider?

So I know you can get the collision normal of the other collider with collision.contacts[n].normal, which gets the normal of the collider we collided with.

I’d like to know if it’s also possible to get the nornal (of the face that collides) of our own collider when we collide.

Thanks!

Wouldn’t that be -collision.contacts[n].normal?

1 Like

Hey Edy!

I’m not sure, if you have two meshes hit each other at an angle, the normals of both meshes should stand at an angle I think? (Situation B in my attachment)

I might be misunderstanding how collisions and their normals work though. But basically what I’d like to know are the blue arrows.

In the case B the object wouldn’t collide with the face, but with the vertex. So the normal of the contact would still be the red arrow reversed.

I see, I suppose collision normals work a bit differently than I expected.

Would there be another way to detect from what direction you’re colliding?
I have a car collision mesh that calculates damage, and I want it to ignore the collisions that happen to the underside of the car.

Checking for simple local y values wouldn’t entirely work I think, considering you might also hit a wall with the side of the car, and still have the contact point very low.

You might try checking the direction of Collision.relativeVelocity as well. I’d try checking both normal and relative velocity at the same time. Maybe there’s a combination of both that matches those specific impacts.

Another posible way might be using a separate collider for the underside. Collisions where this collider is involved would be ignored.

Oh that’s a good one. I’ve been thinking some more on it and I think if you simply transform the negative hit normal to the car’s local space, you should actually have a pretty good estimate.

I’ll try some things out, thanks for your help!

1 Like