Skip to content
lsl.devlsl.devLSL Dev

llGetObjectName

function
Function syntax
string llGetObjectName();
Returns
string
Energy
10

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

How to use
string result = llGetObjectName();
  • The prim name is limited to 63 bytes, any string longer than that will be truncated. This truncation does not always happen when the attribute is set or read.
  • This function may return “(Waiting)” sometimes. See: notes
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));
}
}

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.

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.