do
if mousex()>screen width()-10 then inc camx#,scrollspeed
if mousex()<10 then dec camx#,scrollspeed
if mousey()<10 then inc camz#,scrollspeed
if mousey()>screen height()-10 then dec camz#,scrollspeed
if spacekey()= 1
roll object left 1,2
endif
if leftkey()= 1
move object left 1,1
endif
if upkey()= 1
move object down 1,1
endif
if downkey()= 1
move object up 1,1
endif
if rightkey()= 1
move object right 1,1
endif
if object position y(1) > 2 OR object position y(1) < 2
position object 1,object position x(1),2,object position z(1)
endif
if mouseclick() = 2
pick screen mousex(),mousey(),1
point object 1,mousex(),2,mousez()
repeat
move object 1,1.0
sync
until object position x(1) = mousex() AND object position z(1) = mousez()
endif
rem position camera
position camera camx#,200,camz#
sync
loop
Hi. I'm trying to make this 3d model to move where I right-click, but:
1. when done so, the camera freezes in place.
2. the model often heads in the wrong direction.
3. It does not seem to stop.
My code for the general loop is above.
Can someone please say what's wrong?