How to find an object above or below

To find an object in front or behind I would use vector3.dot as in the following example:

public class example : MonoBehaviour {
    public Transform other;
    void Update() {
        if (other) {
            Vector3 forward = transform.TransformDirection(Vector3.forward);
            Vector3 toOther = other.position - transform.position;
            if (Vector3.Dot(forward, toOther) < 0)
                print("The other transform is behind me!");
            
        }
    }
} 

After toying with some of the variables, I seem to struggle in finding a way to detect if the object is either above or below my position. Would anyone be able to assist in accomplishing detecting whether an object is above or below.

Thank you

Try using Vector3.Dot( up, toOther ).

The dot product should be zero if the vectors are perpendicular to each other, a value greater than 0 if the angle between then is less than 90deg and both point in the same direction, and a value lesser than 0 if the angle is less than 90deg and they point in different directions.

So, basically, if you calculate the dot product between the up vector, and the vector to the other target, and the result is greater than 0 then the other target is above