I have this jumping code
VertSpeed#=(VertSpeed#+Gravity#)
Move Object Up 1,Vertspeed#
If Spacekey() = 0
ground_height# = Get Ground Height(1,Object position X(1),Object Position Z(1))
If Object Position Y(1) < ground_height# + 4
Position Object 1,Object Position X(1),ground_height# + 4,Object Position Z(1)
VertSpeed#=0
Endif
Endif
If Spacekey() = 1 and Object Position Y(1) < Ground_height+4
VertSpeed#=3
Endif
But if i do this
Do
Gosub Dostuff_
Gosub Jumping_
Sync
Loop
Dostuff_:
blah blah
return
Jumping_:
VertSpeed#=(VertSpeed#+Gravity#)
Move Object Up 1,Vertspeed#
If Spacekey() = 0
ground_height# = Get Ground Height(1,Object position X(1),Object Position Z(1))
If Object Position Y(1) < ground_height# + 4
Position Object 1,Object Position X(1),ground_height# + 4,Object Position Z(1)
VertSpeed#=0
Endif
Endif
If Spacekey() = 1 and Object Position Y(1) < Ground_height+4
VertSpeed#=3
Endif
Return
Then it does not work
Thanks for your help