thanks, that cleared it up
Another question. When it transfers from mouse control to object control the screen "tears" and it looks quite bad. How would I smooth the angle from the mouse position to the object's angle?
Playercontrol function below.
+ Code Snippetfunction playercontrol()
playerdata(1).posx=object position x(1)
playerdata(1).posy=get ground height(1,object position x(1),object position z(1))+object size y(1)/2
playerdata(1).posz=object position z(1)
if controlkey()=1
if mousex()>0 and notpressed=1
notpressed=0
position mouse 0,mousey()
endif
smoothingm=85
mangle#=mousex()
else
if controlkey()=0
mangle#=object angle y(1)
notpressed=1
endif
endif
text 5,5,str$(smoothingm)
text 5,25,str$(object angle y(1))
text 5,45,"Wrapped: "+str$(wrapvalue(object angle y(1)))
set camera to follow playerdata(1).posx,playerdata(1).posy,playerdata(1).posz,mangle#,25,15,smoothingm+15,1
position object 1,playerdata(1).posx,playerdata(1).posy,playerdata(1).posz
if upkey()=1 or keystate(17)=1
move object 1,.25
else
if downkey()=1 or keystate(31)=1
move object 1,-.25
endif
endif
if leftkey()=1 or keystate(30)=1
dec playerdata(1).roty,.25
rotate object 1,playerdata(1).rotx,playerdata(1).roty,playerdata(1).rotz
else
if rightkey()=1 or keystate(32)=1
inc playerdata(1).roty,.25
rotate object 1,playerdata(1).rotx,playerdata(1).roty,playerdata(1).rotz
endif
endif
endfunction
Thanks in advance.
[EDIT]
And another question. Using randomize, could I specify a certain random set of numbers so a matrix will always be the same?