Jump to content

How to immobilise avatar - HELP!


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

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

Recommended Posts

Hi,

I am creating a packing crate which is worn and hides the avatar. It also needs to immobilise the avatar so it cannot move whilst wearing the crate.

I have achieved this using the function llTakeControls and preventing any user input from being acted on.

However there appears to be a glitch - when the item is first worn the avatar is able to rotate. This seems to just happen once and after that the avatar doesn't move again.

Can anyone help with understanding the reason behind this and preventing it?

Or is there a better way of achieving this immobilisation?

Thank you 

Link to comment
Share on other sites

Yes - sorry I was unable to show the script before, but here is the relevant part:

 llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS);

 run_time_permissions(integer perm)
    {
        if(PERMISSION_TAKE_CONTROLS & perm)
        {
            llTakeControls(CONTROL_BACK |
                CONTROL_FWD |
                CONTROL_DOWN |
                CONTROL_UP |
                CONTROL_LEFT |
                CONTROL_RIGHT |
                CONTROL_ROT_LEFT |
                CONTROL_ROT_RIGHT,
                TRUE, FALSE);
        }

}

Link to comment
Share on other sites

am not sure where in the script you are calling for permissions. Normally we do this in the attach event

this example code does what you are intending

default
{
    attach(key id)
    {
        if (id) 
            llRequestPermissions(id, PERMISSION_TAKE_CONTROLS);    
    }
    
    run_time_permissions(integer perms)
    {
        if (perms)
            llTakeControls(
                CONTROL_FWD |
                CONTROL_BACK |
                CONTROL_LEFT |
                CONTROL_RIGHT |
                CONTROL_ROT_LEFT |
                CONTROL_ROT_RIGHT |
                CONTROL_UP |
                CONTROL_DOWN |
                CONTROL_LBUTTON |
                CONTROL_ML_LBUTTON ,
                TRUE, FALSE
            );
    }
}

add ps. we don't need to code a control event to prevent controls being passed in this way

Edited by Mollymews
ps
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1566 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...