Sorry about that, I didn't test the code thoroughly enough.
It's a very odd problem. It seems that the "object angle y()" command is not returning the correct angle of the object. If you look at the this example of a rotating cube:
sync on
sync rate 60
hide mouse
cls 0
ObjectNumber=1
make object cube ObjectNumber, 5
while mouseclick()=0
set cursor 0,0
turn object right 1, 0.1
print "object angle x : "; object angle x(ObjectNumber)
print "object angle y : "; object angle y(ObjectNumber)
print "object angle x : "; object angle z(ObjectNumber)
sync
endwhile
It returns a value for the y angle between 90 and -90 (i.e. when the object rotates through say 95 degrees the "object angle y()" command returns a value of 85 degrees) even though the cube rotates through a full 360 degrees. Also, the object's x and z angles change from 0 to 180 degrees (when it has rotated through 90 degree). Maybe someone with a bit more knowledge than me could explain this, it's just odd to me (maybe there's some update I'm unaware of).
I think this was causing the problem not the "set camera to follow" command.
Anyway, I figured out a work around.
Rather than rotating the object directly, the left and right keys change a "facing#" variable and then the object is y rotated to this value (line 62) and I changed the "set camera to follow" command to use the "object angle y()" command (line 148)
//create the sync setup and that kind of stuff.
sync on
sync rate 30
hide mouse
//make a 3D box and some other 3D stuff
//Make Player
make object box 1,5,5,5
color object 1, RGB(255,255,255)
SET OBJECT COLLISION ON 1
//Make matrix
make matrix 1,500,500,20,20
position matrix 1,-11,-11,-10
//Boundaries
make object box 3, 2,20,500 : position object 3, 490, 0, 240
SET OBJECT COLLISION ON 3
Hide Object 3
make object box 4, 500,20,2 : position object 4, 240, 0, -11
SET OBJECT COLLISION ON 4
Hide Object 4
make object box 5, 500,20,2 : position object 5, 239, 0, 490
SET OBJECT COLLISION ON 5
Hide Object 5
make object box 6, 2,20,500 : position object 6, -12, 0, 240
SET OBJECT COLLISION ON 6
Hide Object 6
//Make collectables
for x= 7 to 80
make object sphere x,5
color object x, RGB(255,0,0)
position object x, RND(480),RND(-11),RND(480)
next x
for x= 81 to 115
make object sphere x,6
color object x, RGB(255,255,0)
position object x, RND(480),RND(-11),RND(480)
next x
//make the timer variable.
Timer#=3600
//Main Loop
do
//This is the timer system
Timer#=Timer#-1
If Timer#=<0 then end
//Matrix Boundaries
playerX# = OBJECT POSITION X(1)
playerY# = OBJECT POSITION Y(1)
playerZ# = OBJECT POSITION Z(1)
//Control System
if upkey()= 1 then move object 1,4
if downkey()=1 then move object 1,-4
`modified turning controls
if leftkey() = 1 then facing# = wrapvalue(facing# - 3)
if rightkey() = 1 then facing# = wrapvalue(facing# + 3)
`rotate the object to face in the correct direction
yrotate object 1, facing#
//Print score
set cursor 5,5
Print score#
//Delete collectables as appropriate
For x=7 to 80
If object exist(x)=1
If object collision(1,x)=1 then delete object x: score#=score#+1
endif
Next x
For x=81 to 115
If object exist(x)=1
If object collision(1,x)=1 then delete object x: score#=score#-1
endif
Next x
for t = 3 to 6
IF OBJECT COLLISION(1,t) = 1 THEN POSITION OBJECT 1, playerX#,playerY#,playerZ#
next t
if score#=>1
color object 1, rgb(0,0,0)
endif
if score#=>10
color object 1, rgb(50,0,0)
endif
if score#=>20
color object 1, rgb(255,0,0)
endif
if score#=>30
color object 1, rgb(0,255,0)
endif
if score#=>40
color object 1, rgb(0,0,255)
endif
if score#=>50
color object 1, rgb(255,255,0)
endif
if score#=>60
color object 1, rgb(255,255,255)
endif
if score#=>70
color object 1, rgb(0,255,255)
endif
if score#=>80
color object 1, rgb(255,20,200)
endif
//Winning Condition
if score#=>80
do
set cursor screen width()/2,screen height()/2
set text size 35
set text font "times new roman"
text 300,250, "WELL DONE"
end#=end#+1
if end#=>100 then end
sync
loop
endif
//Use camera tracker to follow player object
set camera to follow object position x(1), object position y(1), object position z(1), object angle y(1), 30, 15, 5, 0
point camera object position x(1), object position y(1), object position z(1)
print Timer#
print "object angle y : ", object angle y(1)
sync
loop