Detecting if an object is walking up/down a hill?

Blitz3D Forums/Blitz3D Programming/Detecting if an object is walking up/down a hill?

Guy Fawkes(Posted 2010) [#1]
How can I detect if my object is walking up or down a hill OR slope?


Floyd(Posted 2010) [#2]
If the Y coordinate is increasing then it is going up.


Guy Fawkes(Posted 2010) [#3]
Not neccessarily. If my character was a bird, that would increase the Y-Coordinate as well.

I need something like maybe a formula AND / OR function. PREFERABLY, a function to detect if a character is walking up or down a hill / slope, OR is walking left / right / diagonal on a hill / slope


Ross C(Posted 2010) [#4]
Check the collision normals. CollisionNX() NY() NZ(). They will tell you the normals of the current collision.


Slomas(Posted 2010) [#5]
as Floyd said, but you can check if the object is grounded also by
comparing it's Y coord with the height of the terrain at that object's x,y coords.


TerrainHeight# ( terrain,grid_x,grid_z )