Thanks but I was talking more about jumping, sorry forgot to say that, this is what I was testing, but it shows and error with friction#=phy get collision friction force y
I was attempting to if your on the ground then gravity=0 if not then gravity=0.5 which activates your falling. Theres 2 problems here that I noticed
1. The error above with friction#
2. When you do the phy move character controller if instantly puts you on the ground, you don't fall.
This is my attempt code
phy start
sync on
sync rate 60
backdrop on
color backdrop 0
autocam off
make object box 1,10,20,10
position object 1,0,-4.89,0
color object 1,rgb(0,0,255)
HEIGHT# = object size y(1)
DEPTH# = object size z(1)
WIDTH# = object size x(1)
phy make box character controller 1,object position x(1),object position y(1),object position z(1),5,10,5,1, 5, 10
make object box 2,100,10,100
position object 2,0,-20,0
make object box 3,5,20,100
position object 3,50,0,0
make object box 4,5,20,100
position object 4,-50,0,0
make object box 5,100,20,5
position object 5,0,0,50
make object box 6,100,20,5
position object 6,0,0,-50
make object box 7,20,5,35
position object 7,40,-5,0
rotate object 7,45,0,0
make object sphere 108,3
position object 108,0,-13,5
rotate object 108,45,0,0
for c=2 to 7
phy make rigid body static box c
NEXT c
phy make rigid body static sphere 108
position camera 0,0,130,0
point camera 0,0,0,0
speed#=50
nspeed#=-50
gravity#=0.5
do
friction#=phy get collision friction force y
if friction# > 0 then gravity = 0
else
gravtiy#=0.5
if gravity# > 0 then phy move character controller 1,1
position camera object position x(1),object position y(1),object position z(1)
rotate camera object angle x(1),object angle y(1),object angle z(1)
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y (1)-2)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+ 2)
if upkey()=1 then phy move character controller 1, speed#
if downkey()=1 then phy move character controller 1, nspeed#
if spacekey()=1 then move object up 1,1
phy update
sync
loop
EDIT:
I also decided to try the camera thing again but it says camx# is not a variable or something, when I defined it as camera angle x(0)
phy start
sync on
sync rate 60
backdrop on
color backdrop 0
autocam off
make object box 1,10,20,10
position object 1,0,-4.89,0
color object 1,rgb(0,0,255)
HEIGHT# = object size y(1)
DEPTH# = object size z(1)
WIDTH# = object size x(1)
phy make box character controller 1,object position x(1),object position y(1),object position z(1),5,10,5,1, 5, 10
make object box 2,100,10,100
position object 2,0,-20,0
make object box 3,5,20,100
position object 3,50,0,0
make object box 4,5,20,100
position object 4,-50,0,0
make object box 5,100,20,5
position object 5,0,0,50
make object box 6,100,20,5
position object 6,0,0,-50
for c=2 to 6
phy make rigid body static box c
NEXT c
position camera 0,0,130,0
point camera 0,0,0,0
speed#=50
nspeed#=-50
do
camx#=camera angle x(0)
position camera object position x(1),object position y(1),object position z(1)
if camx# > 180 then camx# = 179
if camx# < 45 then camx# = 44
rotate camera camx(0)+mousemovey()*0.4,object angle y(1),object angle z(1)
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y (1)-2)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+ 2)
if upkey()=1 then phy move character controller 1, speed#
if downkey()=1 then phy move character controller 1, nspeed#
phy update
sync
loop
I want coke, not Pepsi!