private void OnCollisionEnter(Collision other)
{
var normal = other.GetContact(0).normal;
var collisionTransform = other.transform;
if (normal == collisionTransform.up)
{
Debug.Log("Top");
}
if (normal == -collisionTransform.up)
{
Debug.Log("Down");
}
if (normal == collisionTransform.right)
{
Debug.Log("Right");
}
if (normal == -collisionTransform.right)
{
Debug.Log("Left");
}
if (normal == collisionTransform.forward)
{
Debug.Log("forward");
}
if (normal == -collisionTransform.forward)
{
Debug.Log("back");
}
}