Ive edited the code now the only reason you were getting an error was because you had
make object sphere 2,10
position object 2, 0,0,0
When you should have the object number as one becuse in this part of the code
it looks for the object with a number 1 but there wasnt one made so now it is so it should work for you. Heres the code.
autocam off
sync on
sync rate 60
REM Pre loaded commands
make camera 1
make light 4
position light 4,0,15,0
color light 4, RGB(255,0,0)
position camera 1,-10,-10,-10
point camera 1,0,0,0
make object sphere 1,10
position object 1, 0,0,0
Make object box 5,100,5,100
Position Object 5, 0,-20,0
Fog on
fog color rgb(000,040,000)
fog distance 60
REM In Game Commands
do
if keystate(17)=1 then Pitch Camera Up 1 ,0.5
if keystate(31)=1 then Pitch Camera Down 1,0.5
if keystate(30)=1 then Turn Camera Left 1,0.5
if keystate(32)=1 then Turn Camera Right 1,0.5
if shiftkey()=1 then Move Camera 1,0.5
if spacekey()=1 then Move Camera 1,-0.5
if mouseclick()=1
obj=pick object (mousex(),mousey(),0,20)
endif
`Added this line to prevent no object being selected and getting an error.
if obj = 0
obj = 1
endif
`Setting up movement.
if upkey()=1
move object obj,1 `If you see the variable you declared called obj in line 14 is
endif `used to detect which object you are clicking then putting the object number into the variable.
if leftkey()=1
move object left obj,1
endif
if rightkey()=1
move object right obj,1
endif
if downkey()=1
move object obj,-1
endif
print obj
sync
loop
life is short but so am i