OMG how do you remeber your name when you have to log it?
Anway, here's the correct way to use it:
You will have to set up the objects you want to check with collision boxes first. Here's how you do it:
Obj=whatever object you want to set up
StartX=0-(object size x(Obj)/2)
StartY=0-(object size y(Obj)/2)
StartZ=0-(object size z(Obj)/2)
EndX=object size x(Obj)/2
EndY=object size y(Obj)/2
EndZ=object size z(Obj)/2
make object collision box Obj,StartX,StartY,StartZ,EndX,EndY,EndZ,0
rem define your object numbers
PlayerObj=1
OtherObj=2
rem detect collision and reposition
if object collision(PlayerObj,OtherObj)
dec PlayerX#,get object collision x()
dec PlayerY#,get object collision y()
dec PlayerZ#,get object collision z()
rem if you are using gravity, set it to 0 here
endif
If you want to check collision with
every other object, you just change the OtherObj to 0:
rem define your object numbers
PlayerObj=1
OtherObj=2
rem detect collision and reposition
if object collision(PlayerObj,0)
dec PlayerX#,get object collision x()
dec PlayerY#,get object collision y()
dec PlayerZ#,get object collision z()
rem if you are using gravity, set it to 0 here
endif
Currently, your player will be able to climb up walls if you jump on the side of them (if you're using gravity), to fix this, you will have to check if they are colliding on the Y axis:
rem define your object numbers
PlayerObj=1
OtherObj=2
rem detect collision and reposition
if object collision(PlayerObj,OtherObj)
dec PlayerX#,get object collision x()
dec PlayerY#,get object collision y()
dec PlayerZ#,get object collision z()
if get object collision y()!0 then gravity=0
endif
Hope that fixes your problem
TheComet