Look at your code carefully - you're telling the camera to follow a fixed point in 3D space. Your object moves, but the camera isn't being told to follow it.
Try this code:
sync rate 60
sync on
hide mouse
load image "C:\DBPro Temp\grass2.bmp",1
autocam off
make matrix 1,500,500,60,60
randomize matrix 1,6
prepare matrix texture 1,1,60,60
update matrix 1
make camera 1
' -----------------temporary object------------
make object cube 1,2
position object 1, 20, 4, 30
' ---------------------
angle = 0
dist = 20
height = 10
smooth = 25
do
position object 1, object position x(1), get ground height(1,object position x(1), object position z(1))+1, object position z(1)
set camera to follow 1,object position x(1), object position y(1), object position z(1), angle, dist, height, smooth, 1
if upkey() then move object 1,1
if downkey() then move object 1,-1
if leftkey()
dec x
yrotate object 1,wrapvalue(x)
endif
if rightkey()
inc x
yrotate object 1,wrapvalue(x)
endif
sync
loop
Cheers,
Rich
"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming