llClearCameraParams
void llClearCameraParams()Resets all camera parameters to default values and turns off scripted camera control.
A complete example showing how to toggle camera control on and off with permission checks:
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(); } }}- Requires
PERMISSION_CONTROL_CAMERApermission to function - Use this function to disable scripted camera control and restore the avatar’s default camera behavior
- Call [llSetCameraParams] to enable scripted camera control again after calling this function
See Also
Section titled “See Also”- [llSetCameraParams]