I am experimenting with the camera settings. I have tried a simple script to set the camera with my script. It all seems to work fine except for the start. If the camera has the focus on another object, the scripted camera will not take over. I have to press ESC first to release my camera. Is it possible to do this by script? I thought llClearCameraParams() should do that?
I could narrow down the problem in this script:
CODE
default
{
state_entry()
{
llSitTarget( < 0, 0, .5 >, ZERO_ROTATION );
}
changed(integer change)
{
if (change == CHANGED_LINK)
{
if (llAvatarOnSitTarget())
{
llOwnerSay("sitting");
llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA );
}
}
}
run_time_permissions(integer perm)
{
if ( perm & PERMISSION_CONTROL_CAMERA )
{
llClearCameraParams();
llSetCameraParams([
CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
CAMERA_FOCUS_LOCKED, TRUE, // (TRUE or FALSE)
CAMERA_POSITION_LOCKED, TRUE // (TRUE or FALSE)
]);
vector new_pos = <0, 0, 0>;
llSetCameraParams( [
CAMERA_POSITION, new_pos ]);
}
}
}
this script sets my camery position to vector <0, 0, 0> (just to test that it works) and it works fine if I just sit on the prim. But if I set the camera position/angle by ALT-Clicking on something, the script don't move the camera.
If I can't release the camera by script, is it possible to detect it in the script if the camera is focused on something else? In this case I can just say in the chat "please press ESC to release your camera".
TIA
Jim