I want to know how can I check the collision from different directions.
Let me explain it a little bit; I want to check the collision between my bullet and a platform object from 4 different sides( right, left, top , bottom)
I know I can use 4 different colliders, but there should be a better solution.
I can check the right and the left side, but when I try to include top and bottom everything gets confusing
here is the collision function for right and left edges of the platform;
if(transform.position.x < collision.contacts[0].point.x ||
transform.position.x > collision.contacts[0].point.x)
{
ballVelocity = Vector3.Reflect (ballVelocity,Vector3.right);
transform.rotation = Quaternion.LookRotation(ballVelocity);
}