Detecting inside an area without a collider

Is it possible to detect an object inside a certain area (like a trigger collider) with the object you want to detect having the collider turned off? Sorry if this question sounds a bit weird. I’m very tired.

Sure, there are several ways. If it doesn’t need to be precise or if the area is always a world space aligned box you can simply test against a “Bounds”. A Bounds struct can be aquired from a renderer or a collider. However you can also specify one with arbitrary values. Just a center and a size value that specifies the box. You can use Bounds.Contains to check a worldspace position if it’s inside the bounds. You can also check if two bounds overlap with Bounds.Intersects.

If you need more precision (for example a rotated box) you can do the check manually. You can either use a BoxCollider to specify the area, use it’s center and size properties to specify a localspace Bounds value and just use InverseTransformPoint of the collider object’s transform to convert the point you want to test into local space of the collider. Now you can simply use Contains:

public static bool IsInsideBoxCollider(BoxCollider aCol, Vector3 aPoint)
{
    var b = new Bounds(aBox.center, aBox.size*0.5f);
    var p = aBox.transform.InverseTransformPoint(aPoint);
    return b.Contains(p);
}