I think you may have misunderstood the "GetObjectRayCastNumHits" command. From what I understand it returns the number of calculations performed to come up with collision coordinates and not the number of objects that are intersected by the ray cast.
edit: just having another look at the help files, I don't think that's right and I'm going to say that I don't really know what that's all about or how to use it.
from the help file for "GetObjectRayCastNumHits"
Quote: "Returns the number of collisions that occurred in the last collision check. In the case of ObjectRayCast and ObjectSphereCast this will be 0 or 1. For ObjectSphereSlide this could be anywhere between 0 and 4."
But if ObjectRayCast and ObjectSphereCast only have 0 or 1 "hits" then it doesn't seem to be accounting for multiple objects.
Anyway, moving on:
@ nz0, I tried your model and it work perfectly on v1 V108.2. I've created a couple of examples using it. The first will return the id of the first satalite hit and the second loops through all the satalites:
`detects first collision
for i = 1 to 5
loadObject(i,"dmarsat.obj")
setObjectPosition(i,0,i-3,0)
setObjectRotation(i,0,i*90,0)
next i
createObjectBox(11,0.1,0.1,0.1)
setObjectColor(11,0,255,0,255)
setObjectPosition(11,0.5,3,0)
SetObjectCollisionMode(11,0)
createObjectBox(12,0.1,0.1,0.1)
setObjectColor(12,255,0,0,255)
setObjectPosition(12,0.5,-3,0)
SetObjectCollisionMode(12,0)
setCameraPosition(1,0,1,10)
setCameraLookAt(1,0,0,0,0)
do
for i = 1 to 5
setObjectColor(i,255,255,255,255)
rotateObjectGlobalY(i,0.5)
next i
hit = ObjectRayCast(0, getObjectX(11),getObjectY(11),getObjectZ(11), getObjectX(12),getObjectY(12),getObjectZ(12))
if hit <> 0
setObjectColor(hit,0,0,255,255)
endif
sync()
loop
`loop through all objects
for i = 1 to 5
loadObject(i,"dmarsat.obj")
setObjectPosition(i,0,i-3,0)
setObjectRotation(i,0,i*90,0)
next i
createObjectBox(11,0.1,0.1,0.1)
setObjectColor(11,0,255,0,255)
setObjectPosition(11,0.5,3,0)
createObjectBox(12,0.1,0.1,0.1)
setObjectColor(12,255,0,0,255)
setObjectPosition(12,0.5,-3,0)
setCameraPosition(1,0,1,10)
setCameraLookAt(1,0,0,0,0)
do
for i = 1 to 5
setObjectColor(i,255,255,255,255)
rotateObjectGlobalY(i,0.5)
if ObjectRayCast(i, getObjectX(11),getObjectY(11),getObjectZ(11), getObjectX(12),getObjectY(12),getObjectZ(12)) <> 0
setObjectColor(i,0,0,255,255)
endif
next i
sync()
loop
Apart from that I don't know why your code wouldn't work.