*Using DBC*
sync on
load object "C:\Program Files\Dark Basic Software\DarkMATTER\Models\DB\Vehicles\Jet Fighter\L-Jet Fighter-Move.x",1
Set camera to follow Object position X(1),Object position Y(1),Object position Z(1),Object position Y(1),-15000,0,500,5
rotate camera 0,180,0
do
REM forwards n backwards
fwds#=(fwds#-1)
if keystate(17)=1 then move object 1,(fwds#) else fwds#=(fwds#+1)
if fwds#=<-5 then fwds#=-5
if fwds#=>0 then fwds#=0
bwds#=(bwds#+1)
if keystate(31)=1 then move object 1,(bwds#) else bwds#=(bwds#-1)
if bwds#=>2 then bwds#=2
if bwds#=<0 then bwds#=0
REM rotate left n right
lrot#=wrapvalue(lrot#-1)
if leftkey()=1 then rotate object 1,0,0,lrot#
rrot#=wrapvalue(rrot#+1)
if rightkey()=1 then rotate object 1,0,0,rrot#
REM forward n backwards rotate
rotd#=wrapvalue(rotd#-1)
rotu#=wrapvalue(rotu#+1)
if upkey()=1 then rotate object 1,rotd#,0,0
if downkey()=1 then rotate object 1,rotu#,0,0
sync
loop
Just a question. Is there a way of getting the camera to follow an object? I have the command *set camera to follow* but it doesnt seem to actually follow the object. Did I cancel it out by putting *rotate camera* command in there? OR do you have to code it yourself, ie
do
if upkey()=1 then move object 1,1
position camera objectsXposition#,objectsYposition#,objectsZposition
sync
loop
or is there just a command which tells it to follow the object.
Thanks for the help!
PS Ive posted the code above and just noticed an error whilst testing it. When i press the keys to tell it to rotate, it does funny things (rotates fine but doesnt start rotating from 0 degrees)
If anyone has any ideas about the second thing that'd be great too!