if you are talking about objects you have brought into play
//*******************************************************************************************
//gets the distance between two objects passed
//*******************************************************************************************
function getDistance(objectID as integer,objectID2 as integer)
distance as float
vec1=CreateVector3(GetObjectWorldX(objectID),GetObjectWorldY(objectID),GetObjectWorldZ(objectID))
vec2=CreateVector3(GetObjectWorldX(objectID2),GetObjectWorldY(objectID2),GetObjectWorldZ(objectID2))
distance=GetVector3Distance(vec1,vec2 )
DeleteVector3(vec1)
DeleteVector3(vec2)
endfunction distance
You should be able to replace the above with camera coordinates and if you cant get that to work just position an invisible
object where the camera is
if you mean like detect a real table as such and its distance from the camera that requires quite allot of work