hi all,
what i want my game to do is when the gun which is locked in object 1 has collision with something (in this case a cube) the camera can not go any further because of collision. At the moment when it collides it is hesistant for a second and then lets through please help me fix the code.
rem set up sync
sync on
sync rate 30
moveable = 1
hide mouse
make object cube 55,50
position object 55,400,0,300
set object collision on 55
rem load object gun
load object "MP5.3DS",1
do
scale object 1,500,500,500
position object 1,0.2,-1.3,1
lock object on 1
set object collision on 1
cZ# = camera angle Y()
X# = camera position x()
Z# = camera position z()
if moveable = 1
if upkey()=1 then move camera 1
if downkey()=1 then move camera -1
if rightkey()=1 then Yrotate camera (cZ#+1)
if leftkey()=1 then Yrotate camera wrapvalue(cZ#-1)
endif
set global collision on
If Object collision(55,1) >0
position camera 400,0,300
moveable = 0
endif
sync
loop