As promised, here is the code. I'm attaching the entire test program here, so you can load it and test it out. It's really simple, arrow keys to move, that's it. The numbers in the corner represent object 1 and object 2, showing the number that they are in collision with.
In a perfect world, the numbers should read 2 1, but instead, they always read 0 0. You get the picture.
sync on
sync rate 30
cls
hide mouse
backdrop on
set global collision off
make object cube 1, 50
make object collision box 1, -25, -25, -25, 25, 25, 25, 0
set object collision on 1
make object cube 2, 50
make object collision box 2, -25, -25, -25, 25, 25, 25, 0
set object collision on 2
position object 2,800,1,800
position object 1, 1000, 1, 1000
do
set cursor 10,10
print object collision(1,0)
set cursor 20,10
print object collision(2,0)
if upkey() > 0
move object 1, -8
endif
if downkey() > 0
move object 1, 8
endif
if leftkey() > 0
yrotate object 1,wrapvalue(object angle y(1) - 5)
endif
if rightkey() > 0
yrotate object 1,wrapvalue(object angle y(1) + 5)
endif
xpos = object position x(1)
ypos = 1
zpos = object position z(1)
position object 1, xpos, ypos, zpos
move_camera(1)
sync
loop
function move_camera(ObjectId)
objectdist = 75
ObjectYAngle = object angle y(ObjectId)
NewObjectX = object position x(ObjectId)
NewObjectY = object position y(ObjectId)
NewObjectZ = object position z(ObjectId)
CameraYAngle = wrapvalue(ObjectYAngle+180)
NewCameraX = NewXValue(NewObjectX,ObjectYAngle,objectdist)
NewCameraY = NewObjectY + 50
NewCameraZ = NewZValue(NewObjectZ,ObjectYAngle,objectdist)
position camera NewCameraX, NewCameraY, NewCameraZ
point camera NewObjectX, NewObjectY+25, NewObjectZ
endfunction
Hopefully you guys will have better luck with this than I have.