Detecting if an object is walking up/down a hill?
Blitz3D Forums/Blitz3D Programming/Detecting if an object is walking up/down a hill?
| ||
How can I detect if my object is walking up or down a hill OR slope? |
| ||
If the Y coordinate is increasing then it is going up. |
| ||
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 |
| ||
Check the collision normals. CollisionNX() NY() NZ(). They will tell you the normals of the current collision. |
| ||
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 ) |