Okay so I am trying to make a cube move with the mouse so that it is on the terrain. The only problem is that it doesn't go to the top of the screen. I know I am using pick screen incorrectly but I need a way for the cube to always be y=0
sync on : sync rate 60
gosub _make_map
gosub _setup_display
do
gosub _camera_control
gosub _display
sync
loop
_make_map:
make matrix 1,3200,2400,160,120
for tint1 = 0 to 160
for tint2 = 0 to 120
SET MATRIX HEIGHT 1,tint1,tint2,rnd(10)
next tint2
next tint1
update matrix 1
autocam off
return
_setup_display:
xrotate camera camera angle x()+30
color backdrop rgb(0,0,0)
make object cube 1,10
return
_camera_control:
camx=camera position x()
camy=camera position y()
camz=camera position z()
camspeed=10
if leftkey()=1 then position camera camx-camspeed,camy,camz : camx=camera position x()
if rightkey()=1 then position camera camx+camspeed,camy,camz : camx=camera position x()
if upkey()=1 then position camera camx,camy,camz+camspeed : camz=camera position z()
if downkey()=1 then position camera camx,camy,camz-camspeed : camz=camera position z()
if mousex()<10 then position camera camx-camspeed,camy,camz : camx=camera position x()
if mousex()>1014 then position camera camx+camspeed,camy,camz : camx=camera position x()
if mousey()<10 then position camera camx,camy,camz+camspeed : camz=camera position z()
if mousey()>758 then position camera camx,camy,camz-camspeed : camz=camera position z()
`sort this out
`PICK SCREEN mousex(),mousey()-200,camy / sin(90-30)
pick screen mousex(), mousey(), camy
position object 1,camx+GET PICK VECTOR x(),0,camz+GET PICK VECTOR z()
return
_display:
return
Please could somebody give me a simple code that will mean the cube is always a mousex() and mousey() but at y=0