ah yh it doesn't keep checking once a collision is found, thought it did, sorry.
but you can use a specific object and keep checking from the contact point to the desired end point (i.e. until it hits the desired object) though that requires you to turn off the collision of any object in the way i think - like so
Create3DPhysicsWorld()
player = CreateObjectCapsule(1,2,1)
SetObjectPosition(player,0,0,0)
MoveObjectLocalZ(player,-5)
MoveObjectLocalY(player,4)
Create3DPhysicsCharacterController(player,1,CreateVector3(0.5,1,0.5),CreateVector3(0,0,-1),1)
rayt = CreateObjectBox(1,1,1)
other_player = CloneObject(player)
SetObjectScale(other_player,3,3,3)
MoveObjectLocalZ(other_player,-10)
SetObjectColor(other_player,255,0,0,255)
SetCameraPosition(1,0,0,0)
MoveCameraLocalZ(1,-10)
SetCameraLookAt(1,GetObjectX(other_player),GetObjectY(other_player),GetObjectZ(other_player),0)
hits as integer[]
do
Print("player obj id = "+str(player))
Print("other_player id = "+str(other_player))
Print("rayt id = "+str(rayt))
Print("")
if GetRawKeyPressed(27) then end
if GetRawMouseLeftReleased()
cx = GetCameraX(1)
cy = GetCameraY(1)
cz = GetCameraZ(1)
SetObjectPosition(rayt,cx,cy,cz)
SetObjectRotation(rayt,GetCameraAngleX(1),GetCameraAngleY(1),GetCameraAngleZ(1))
MoveObjectLocalZ(rayt,100)
temp = hits.length
for a = 0 to temp
hits.remove()
next a
temp = -1
repeat
ray = ObjectRayCast(0,cx,cy,cz,GetObjectX(rayt),GetObjectY(rayt),GetObjectZ(rayt))
cx = GetObjectRayCastX(0)
cy = GetObjectRayCastY(0)
cz = GetObjectRayCastZ(0)
hitid = GetObjectRayCastHitID(0)
inc temp, 1
hits.insert(hitid)
SetObjectCollisionMode(hitid,0)
Sync()
until hitid = rayt
for a = 0 to temp
SetObjectCollisionMode(hits[a],1)
next a
endif
for a = 0 to hits.length
Print("hit obj id "+str(hits[a]))
next a
sync()
loop
p.s. i'm not sure how the character controller interacts with the world scale but for the example above it doesn't appear to have any impact on the ray cast?
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu