I want to check the direction of which an object is colliding into other. Is this possible?
I have two gameobjects, a Box and a Stone. Both has a collider with IsTrigger checked. The Stone has a rigidbody. I have a script on the Box that has an OnTriggerEnter function. This function is called when the Stone hits/collides the Box.
Now, I want to know if the Stone actually fell from the top and hit the Box. If the Stone hit the Box from the top, ie, the Stone fell from the top and collided on the top of the Box, I want it to do something. If it the Stone hit the Box from the sides, then it could do another thing.
Can colliders check for the direction something was hit?
You'd also get a ContactPoint array, which you could use the normal of the contacts to figure the direction if you preferred.
– whebert