Hi All
writing a bit of code, for some reason a small .1,.1 plain will not stay that size when used as a locked object.
here's the code for spotting if I've done something wrong, or have I found a bug in lock objects?
the plain will be used as a top down screen of playing area.
sync on
sync rate 60
autocam off
color backdrop 0
dim gun(3)
global id camx camy
id=0
ground=getid(id)
make object box ground,1000,1,1000
color object ground, RGB(0,192,75)
position object ground,0,-1,0
gun1=getid(id)
make object cone gun1,2
position object gun1,0,0,-15
gun2=getid(id)
make object cone gun2,2
position object gun2,-15,0,15
gun3=getid(id)
make object cone gun3,2
position object gun3,15,0,15
position camera 0, object position x(gun1),object position y(gun1)+2,object position z(gun1)
gun(1)=gun1
block1=getid(id)
make object box block1,1,5,1
vidscreen=getid(id)
rem this bit here =================================
bd=getid(id)
make object plane bd,.1,.1
lock object on bd
position object bd, 0,-.5,1
rem ===============================================
do
text 0,0, str$(camx)
text 0,20, str$(camy)
text 0,30,"@ gun "+str$(gun(1)-1)
if keystate(2) then gun(1)=gun1
if keystate(3) then gun(1)=gun2
if keystate(4) then gun(1)=gun3
crosshairs()
movecamera(gun(1))
sync
LOOP
function getid(nid)
inc nid
id=nid
ENDFUNCTION id
function crosshairs()
line screen width()/2-10,screen height()/2,screen width()/2-1,screen height()/2
line screen width()/2+10,screen height()/2,screen width()/2+1,screen height()/2
line screen width()/2,screen height()/2-10,screen width()/2,screen height()/2-1
line screen width()/2,screen height()/2+10,screen width()/2,screen height()/2+1
ENDFUNCTION
function movecamera(thegun)
camx=camera angle x(0)+(mousemovey()/2.0)
`camy=camera angle y(0)+(mousemovex()/2.0)
if camx>=0
camx=0
else
if camx<-147
camx=-147
endif
ENDIF
if mouseclick()=1 then camy=camera angle y(0)+1
if mouseclick()=2 then camy=camera angle y(0)-1
Rotate Camera camx,camy,0
position camera 0, object position x(thegun),object position y(thegun)+2,object position z(thegun)
ENDFUNCTION
Dark Physics makes any hot drink go cold.