TerrainY not exact ?

Blitz3D Forums/Blitz3D Beginners Area/TerrainY not exact ?

b32(Posted 2006) [#1]
Is there something wrong with TerrainY ? I tried keeping a character above the terrain with this command, but sometimes it sinks halfway through the floor.
When I use LinePick, it stays on the ground allways.
I tried to isolate the problem with this code:

And I noticed that there is a difference between TerrainY and LinePick. Has anybody experienced this before or is there something I am doing wrong ?


GfK(Posted 2006) [#2]
Use TerrainHeight() instead of TerrainY.

Don't forget to multiply the result by whatever you scaled the terrain by on the Y axis, since TerrainHeight returns a float between 0 and 1.