Thanks, tried it but it still doesnt work, im assuming this is to do with the physics being on it, any more ideas?
Here is my code.
REM Project: TGC Competition Entry V0-01
REM Created: 05/09/2006 13:32:18
REM
REM ***** Main Source File *****
REM
rem #include "TGC Competition 2006 Menu.dba"
set display mode 1024,768,32,0
sync on
sync rate 30
autocam off
hide mouse
phy start
backdrop on
set camera range 1,5000
fog on
fog distance 4000
fog color rgb(128,128,128)
color backdrop rgb(128,128,128)
x# = - 200
z# = 5
y# = 200
player1sphere = 1
player1gun1a = 2
level1 = 3
xLook AS FLOAT
yAng AS FLOAT
lookSpeed AS FLOAT = 0.2
undim used() : dim used(10000)
make object sphere player1sphere,1
position object player1sphere,x#,y#,z#
load object "pistol1.x",player1gun1a
phy make material 1, "my material"
phy set material restitution 1,0.5
phy build material 1
phy make rigid body dynamic sphere player1sphere,1
phy set rigid body mass player1sphere, 20000
fix object pivot player1gun1a
scale object player1gun1a,700,700,700
position object player1gun1a,1,-1.5,3
lock object on player1gun1a
load object "warehouse0.x",level1
scale object level1,500,500,500
phy make rigid body static mesh level1
do
mouseMovementX = MOUSEMOVEX()
mouseMovementY = MOUSEMOVEY()
yAng = WRAPVALUE(yAng + mouseMovementX*lookSpeed)
xLook = WRAPVALUE(xLook + mouseMovementY*lookSpeed)
ROTATE OBJECT player1sphere,0,yAng,0
POSITION CAMERA object position x(player1sphere),object position y(player1sphere)+5,object position z(player1sphere)
ROTATE CAMERA xLook,yAng,0
rem phy set rigid body gravity player1sphere, 0
` turn left
if leftkey ( ) = 1
phy set rigid body angular velocity player1sphere, 0, -1.0, 0
endif
` turn right
if rightkey ( ) = 1
phy set rigid body angular velocity player1sphere, 0, 1.0, 0
endif
` apply force
if upkey ( ) = 1
phy add rigid body local force player1sphere, 1000, 0, 0, 5
endif
` stop linear momentum
phy set rigid body linear momentum player1sphere, 0.0,-100.0,0.0
phy update
` reset angular velocity
phy set rigid body angular velocity player1sphere,0.0,0.0,0.0
sync
loop