Get depth of Object

I need to get the distance through an object or depth to calculate the size of an actor I am spawning. I’ve tried using bounding boxes but i dont fully understand them and they dont seem like they will work.