I have a unit colliding with terrain and need help finding the direction the terrain hit was facing.
My unit is a flying unit that ignores terrain height, and collision is detected by the Z of the unit being lower than the Z of the world height.
Terrain can be facing 8 possible ways, the standard 4, and the 4 diagonals.
I attempted to find it through checking point(x+1,y) and point(x-1, y) (then vise versa for the y's), to find which side of the terrain had a higher Z point, but it doesn't have 100% accuracy. I don't need the exact angle of the wall, just if it is closer to 0, 45, 90, etc.
Anyone know a solution? thanks for any help!
My unit is a flying unit that ignores terrain height, and collision is detected by the Z of the unit being lower than the Z of the world height.
Terrain can be facing 8 possible ways, the standard 4, and the 4 diagonals.
I attempted to find it through checking point(x+1,y) and point(x-1, y) (then vise versa for the y's), to find which side of the terrain had a higher Z point, but it doesn't have 100% accuracy. I don't need the exact angle of the wall, just if it is closer to 0, 45, 90, etc.
Anyone know a solution? thanks for any help!