Good idea! for those who are a little confused by my post try this:
sync on : sync rate 30
make camera 1
rotate camera 1,45,45,0
move camera 1,-500
phy start
global yrotation#
make object sphere 1,20
scale object 1,100,300,100
color object 1,rgb(255,0,0)
phy make rigid body dynamic capsule 1
phy set rigid body position 1,0,20,0
make object box 2,500,10,500
color object 2,rgb(0,0,255)
position object 2,0,-5,0
phy make rigid body static box 2
do
text 10,10,"----------------------------"
text 10,20,"Character Controller Example"
text 10,30,"----------------------------"
text 10,50,"Controls"
text 10,60,"--------"
text 10,70,"Move: Arrowkeys"
text 10,80,"Turn: < > keys"
text 10,100,"If you`re using DP 1.03 this demo"
text 10,115,"shouldnt work because the command"
text 10,130,"phy set rigid body rotation clears"
text 10,145,"the anglular and linear velocity."
text 10,160,"Without that command the character"
text 10,175,"controller will fall over."
move=0
strafe=0
`THIS COMMAND STOPS THE CHARACTER FROM FALLING OVER.
`IN V1.03 IT ALSO STOPS THE CHARACTER FROM MOVING
phy set rigid body rotation 1,0,0,0
if leftkey() then strafe=-1
if rightkey() then strafe=1
if upkey() then move=1
if downkey() then move=-1
if keystate(51) then yrotation#=yrotation#-2
if keystate(52) then yrotation#=yrotation#+2
xvel#=(sin(yrotation#)*move+sin(yrotation#+90)*strafe)*100
yvel#=phy get rigid body linear velocity y(1)
zvel#=(cos(yrotation#)*move+cos(yrotation#+90)*strafe)*100
phy set rigid body linear velocity 1,xvel#,yvel#,zvel#
phy update
sync
loop
Ive tried everything to get it working with the latest versions but it doesn work