Syntax

string llGetObjectName();

Forced delay: 0.0 seconds. Energy: 10.0.

Return value

Returns a string that is the name of the prim the script is attached to.

This function does not get the name of the object's rootprim, but the name of the prim containing the script. Please use llGetLinkName(LINK_ROOT); instead.

Caveats

Examples

Get this prim's nameGet the root prim's name
default
{
    state_entry()
    {
    //  PUBLIC_CHANNEL has the integer value 0
        llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() );
    }
}
default
{
    state_entry()
    {
    //  PUBLIC_CHANNEL has the integer value 0
        llSay(PUBLIC_CHANNEL, "Root prim's name: "
            + llGetLinkName(LINK_ROOT));
    }
}

Notes

Erroneous "(Waiting)"

Presumably the function queries the asset server for a predetermined time and returns "(Waiting)" if that elapses. It then silently proceeds to the next instruction. A work around therefore, might be to test object name is not "(Waiting)" after calling llGetObjectName.

See also

Functions

Articles