Collision Problem-How to keep character on varying ground levels?!!!

Blitz3D Forums/Blitz3D Programming/Collision Problem-How to keep character on varying ground levels?!!!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I just do a linepick straight down and alter the players position based on the PickedY#() and the players YPosition.

This way you can smooth out stairs so the camera doesn't bump up and down them.

LinePick EntityX#(p\head,True),EntityY#(p\head,True),EntityZ#(p\head,True),0,-50,0

currentheight#=EntityY#(p\head,True)-PickedY#()
currentpicked=PickedEntity()

If currentpicked<>0
If currentheight#<p\height#
MoveEntity p\head,0,(p\height#-currentheight#)/10,0
EndIf
If currentheight#>p\height#
MoveEntity p\head,0,-(currentheight#-p\height#)/5,0
EndIf
EndIf