`get data
posx# = object position x(id)
posy# = object position y(id)
posz# = object position z(id)
angy# = object angle y(id)
`set var (can be set outside the loop too. Just for the example here)
toosteep# = 5.0
`controls
if upkey() = 1
testx# = newxvalue(posx#,angy#,1)
testz# = newzvalue(posz#,angy#,1)
if abs(get ground height(1,testx#,testz#) - get ground height(1,posx#,posz#) < toosteep#
posx# = testx#
posz# = testz#
posy# = get ground height(1,posx#,posz#)
endif
endif
if leftkey() = 1 then yrotate object id,wrapvalue(angy# - 2)
if rightkey() = 1 then yrotate object id,wrapvalue(angy# + 2)
`update object
position object id,posx#,posy#,posz#
This should work with any matrix. Change the "toosteep#" variable to change the max height difference.
Immunity and Annihalation makes Immunihalation...