Tibbybob Posted December 23, 2011 Share Posted December 23, 2011 Hello,I want to display the water depth from the surface to the bottom, when a boat is floating near the shoreline. I have experimented with variations of depthString="Water Depth "+(string) llRound((llWater( ZERO_VECTOR ))/3.28)+ "Feet\n"; but the depth seems to be wrong when the boat is out in open water and it doesn't change when you get to shore (where the water comes up to my waist if I stand beside the boat). I expected llWater to display the depth directly under the center of the prim where the script is located, based on the description at http://wiki.secondlife.com/wiki/LlWater.Is the problem with my script, or with my understanding of what the function should do? (or both?)Thanks,Tibbybob Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted December 23, 2011 Share Posted December 23, 2011 llWater() just tells you the height above 0m at which water has been set for that sim (typically 20m). If you want the depth you have to calculate it by subtracting the llGround() height. That is; if the ground is below the water-level you have positive depth (llWater(ZERO_VECTOR) - llGround(ZERO_VECTOR)). On the other hand, of course, if the ground is above the water-level then you've run aground. Link to comment Share on other sites More sharing options...
Tibbybob Posted December 23, 2011 Author Share Posted December 23, 2011 That's it! Thank you very much!! Also noticed that I have to multiply instead of divide, to convert meters to feet. duh... Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now