Don't click here unless you want to be banned.

LSL Wiki : llGround

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl836.us.archive.org
float llGround(vector offset)

Returns the ground height at the script's current position in the simulator + offset.

So to get the ground height at the scripted object's current location, use: llGround( <0.0, 0.0, 0.0> )

To actually change the ground height, use llModifyLand.

More details at land.

Also see llGroundContour, llGroundSlope, llGroundNormal, and llSetHoverHeight.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Simulator | Land
Comments [Hide comments/form]
As of 1.8.3, it seems that llGround has been fixed -- Or at least changed to be consistant with how it works when attached. It now returns the ground offset from non-attached object's position + offset, instead of just from <0, 0, 0> + offset.
-- FenrirReitveld (2006-02-14 10:28:24)
Confirmed. As this chunk below indicates, there's some broke scripts out there now.

My personal observations are that llGround returns as if it where at <0,0,0> in the simulator when it's attached. It isn't the only function that does this behavior; llEmail does the same. llGround(llGetPos()) will return the current location's ground height, but only when you're wearing the object the script is in. -Ice
Workaround:
float groundHeight(vector offset) {
    if(llGetAttached())
        offset += llGetPos();
    return llGround(offset);
}
Warning: This will stop working if LL fixes this bug.
-- ReadyJack (2006-02-28 21:41:57)
There seems to be a lot of confusion about llGround. The key is that llGround returns the height of the ground OFFSET to the center of the object running the script. Thus, if you want to measure the height of the land immediately beneath your object, use llGround ( ZERO_VECTOR) rather than the often quoted llGround ( llGetPos() )!!!
-- BenHolt (2006-06-11 13:27:18)
No, Ben, the reason people are using llGround(llGetPos()) is because on attachments, llGround() returns as though it were at <0,0,0>. The obvious way to fix this glitch is by setting the offset to your position.

It quite clearly says this in the wiki entry above.
-- DolusNaumova (2006-06-12 11:51:09)
Note that this tells you the ground height, not the highest elevation of any objects or water at the target location. llGround works great over plain ground, but if someone has built thick streets, a bridge, or say, a dock, llGround does very badly. Anyone know a way around this?
-- UnotiQuonset (2006-06-23 21:21:54)
Well, if there were a llPrim, it would be really useful :).
-- KairaOverdrive (2006-08-22 11:57:47)
Attach a comment to this page: