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.

While programming the controls for my game ,i got stuck on a collision problem which is pestering me for some times!!! Please help!

How can i keep my character walking on the ground of my level(created in a modelling package,so it is not a terrain)??!!When the height of the ground is the same everywhere,there`s no problem since i can position the character on it(Like PositionEntity character,0,fixedheightofcharacterabovegroud,0) and everything will work ok. But when it comes to varying gound levels,like climbing stairs or crossing bridges,then it gets messy. I tried this after some tries but it didn`t work(This code is ONLY only for lowering the character`s heigt):

y#=character current height
Entitytype character,1
Entitytype level,2
If Not(Entitycollided character,2) then Positionentity character 0,y#-.1,0

I first thought that it would test to see if the character is touching the ground and then reduce it`s height until it does but unfortunately it isn`t working. My character is half in the ground when i use this but when i walk DOWN the stairs. My characters height about the ground is reduced to that of the stairs but my character still half stuck in the ground. Please help!!!!!!