Skip to content
lsl.devlsl.devLSL Dev

llClearCameraParams

function

Replaces deprecated llReleaseCamera.

Function syntax
llClearCameraParams();
Energy
10

Resets all camera parameters to default values and turns off scripted camera control. Requires the PERMISSION_CONTROL_CAMERA runtime permission (automatically granted for attached or sat-on objects).

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

How to use
llClearCameraParams();
Example 1
44 collapsed lines
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();
}
}
}
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.