public static Collider2D ComputeVerticalRayWithoutEffector(Vector2 origin, Collider2D refCollider, float forward, int objectLayer, bool drawDebug = false, float debugDuration = 0f) { float distance = refCollider.bounds.size.y * 0.75f; origin.x += forward * refCollider.bounds.size.x * 0.55f + (forward * 0.1f); origin.y += refCollider.bounds.size.y * 0.4f + refCollider.offset.y; int layer = CollisionMatrixLayerMasks.MaskForLayer(objectLayer); if (drawDebug) { Debug.DrawRay(origin, Vector3.down * distance, Color.red, debugDuration); } RaycastHit2D hitInfos = Physics2DUtility.RaycastAllWithoutEffector(origin, Vector2.down, distance, layer, drawDebug); return(hitInfos ? hitInfos.collider : null); }