I hate to give out code that takes me so long to write, but I really take pride in this little bit. It's for the sliding collision example, and it impliments the idea of stairs. It takes a lot more to code stairs than you'd think! Anyway, cut the collision code in the sliding collision example (which is this)
position object 11,posx#,posy#,posz#
if object collision(11,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=0.0
endif
And replace it with this:
position object 11,posx#,posy#,posz#
hit#=object collision(11,0)
if object collision(11,0)>0
if get object collision y() then playergrav#=0
if (get object collision x())+(get object collision z())
if ((object size(hit#)+object position y(hit#))-posy#)