Jump to content
Sign in to follow this  

water deep

Recommended Posts


did someone know how to get the water depth with script commands?

If I create a invisible heli_h on water and use getpos, getPosASL, getPosASLW and getPosATL I allways get the position on waterface.

I need a solution to get the groundposition (depth) for creating scripted waypoints under water.

Thx for help!

Share this post

Link to post
Share on other sites

Iceman is right:

if (surfaceIsWater _pos) then getPosATL select 2 on a floating object will give you water depth.

setPosATL[_x,_y, 0] will put anything to the surface whether below water or not.

Simply creating object (without setPosATL) will create the object floating.

So you'll need to

_object setPosATL [(getPos _object) select 0, (getPos _object) select 1, 0];

after creating it.

SetPos after creating an object is usually a more precise approach, since creating creates an object wherever the engine finds some space for it.

Edited by zapat

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this