Whenever you reposition an object you need to update it. This edited code gives collision against your object. I didn't get why you are using raycast also.
Rem Project: colldemo
Rem Created: Monday, January 03, 2011
Rem ***** Main Source File *****
type v3
x as float
y as float
z as float
endtype
op as v3
t as v3
sync on
sync rate 60
autocam off
position camera 0,5,0
load object "testobj.x", 1
sc_setupComplexObject 1,1,2
position object 1,0,0,40
sc_updateobject 1
make object sphere 2,5
SC_setupObject 2,0,1
position object 2,5,0,10
do
if upkey()=1 then move object 2, .1
if downkey()=1 then move object 2, -.1
sc_updateobject 2
collide = sc_groupcollision(2,1)
text 1,1,"collide = " + str$(collide)
SlideX# = 0.0 : SlideY# = 0.0 : SlideZ# = 0.0
if collide > 0
SlideX# = sc_GetCollisionSlideX()
SlideY# = sc_GetCollisionSlideY()
SlideZ# = sc_GetCollisionSlideZ()
position object 2,SlideX#,SlideY#,SlideZ#
sc_updateObject 2
ENDIF
text 1,12,"SlideX# = " + str$(SlideX#)
text 1,24,"SlideY# = " + str$(SlideY#)
text 1,36,"SlideZ# = " + str$(SlideZ#)
objposv3(2)
text 1,48,str$(sc_SphereCastGroup(1,op.x,op.y,op.z,t.x,t.y,t.z,5,0))
sync
LOOP
function objposv3(onum as dword)
t.x=object position x(onum)
t.y=object position y(onum)
t.z=object position z(onum)
ENDFUNCTION
Hope this helps,
LB