Game Development Community

How to get the GROUND HEIGHT before placing an object

by Bill Fisher · in Torque Game Engine · 03/24/2004 (4:35 pm) · 2 replies

I am spawning some random objects over the landscape but I need to make the object height the same as the surface of the land.

I would ALSO like to check for collision of any solid interior objects too - so i dont place the object inside a solid brush.

Any ideas the best way to check for these 2 things?

Thanks
Bill

#1
03/24/2004 (5:29 pm)
For Terrain height use getTerrainHeight(x,y)(not sure on the exact order of the x,y)

I would use a container search for the detecting if point is too close to interior (take a look at radiusdamage.cs for an example of searching a radius for certain type masks.)
#2
03/24/2004 (5:53 pm)
Thanks Bruce for the quick reply! It works great!

I searched the entire .cs scripts for something like that but couldnt find anything (didnt want to mess with the sourcecode) - ofcourse if I would of searched the sourcecode I would of noticed that console command.


Thanks Again!