Jump to content

How do I detect if the owner (me) is sitting on an object?


Leo1452
 Share

You are about to reply to a thread that has been inactive for 1297 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I don't know the context of your situation, but one way is to use llGetAnimation(llGetOwner()) in an attached prim.  SL default animations are; "Standing" if not sitting,  "Sitting" if sitting on a prim, or "Sitting on Ground" if sitting on the ground.  Of course, any AO usage will complicate the result.  If the animation name is "Sitrting" then TRUE, you're on a prim, else if it's "Sitting on Ground", then FALSE, you're not sitting on a prim.

Edited by DoteDote Edison
Link to comment
Share on other sites

After seeing the responses and re-reading the question I realize that "whether or not I am seated on an object" is about any object, not any particular object, but just in case that ever comes up, OBJECT_ROOT is handy:

default
{
    state_entry()
    {
        key owner = llGetOwner();
        key ownerSeat =  llList2Key(llGetObjectDetails(owner, [OBJECT_ROOT]), 0);
        integer ownerSittingp = ownerSeat != owner;	// bool, for ANY object
        llOwnerSay((string)ownerSittingp);
    }
}

 

  • Like 2
Link to comment
Share on other sites

llGetAgentInfo would be the way to go, but you'd need it on a timer. Below is a very rough idea, but check llGetAgentInfo for more details

integer CheckAgentSitting()
{
    integer iAgentSitting = llGetAgentInfo(llGetOwner());
    return (iAgentSitting & AGENT_SITTING);
}

timer()
{
    integer iAgentSitting = CheckAgentSitting();
}

 

Edited by Bugs Larnia
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1297 days.

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
 Share

×
×
  • Create New...