Skip to content

LlClearCameraParams

Looking for the current API? Open the llClearCameraParams reference →

Wiki description

Resets all camera parameters to default values and turns off scripted camera control.

Examples

integer gEnabled;

askForPermissions()
{
    llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA);
}

default
{

    on_rez(integer sp)
    {
        llResetScript();
    }

    state_entry()
    {
        askForPermissions();
    }

    touch_start(integer total_number)
    {

        if (llDetectedKey(0) != llGetOwner())
        {
            return;
        }
        else if (!llGetPermissions() & PERMISSION_CONTROL_CAMERA)
        {
            llOwnerSay("I need permissions to control your camera.");
            askForPermissions();
            return;
        }

        gEnabled = !gEnabled;
        if (gEnabled)
        {
            llOwnerSay("Enabled.");
            llSetCameraParams([
                CAMERA_ACTIVE, 1, 
                CAMERA_DISTANCE, 50.0
            ]);
        }
        else
        {
            llOwnerSay("Disabled.");
            llClearCameraParams();
        }

    }

}

See also: functions

Additional wiki content

To run this function the script must request the PERMISSION_CONTROL_CAMERA permission with llRequestPermissions.
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.