Don't click here unless you want to be banned.

LSL Wiki : LibraryCameraFollower

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

Camera Follower

Originally created by ArkLehane who edited the version posted here and credited to him on this Wiki out of existance.
Re-created and rebuilt by WolfWings Majestic because the script idea is useful, but the original version could be improved on.

Moves an object to the position of your camera.

integer channel = 0;

default {
    state_entry() {
        llRequestPermissions(llGetOwner(),PERMISSION_TRACK_CAMERA);
    }
    run_time_permissions(integer perm) {
        if (perm & PERMISSION_TRACK_CAMERA) {
            state camera_captured;
        }
    }
}

state camera_captured {
    state_entry() {
        llListen(channel,"",llGetOwner(),"");
        llSetStatus(STATUS_PHYSICS,TRUE);
        llSetTimerEvent(0.1);
    }
    timer() {
        llMoveToTarget(llGetCameraPos()+<0.0,0.0,1.0>,0.1);
    }
    listen(integer channel, string name, key id, string message) {
        if (llToLower(message) == "hold") {
            state camera_captured_disabled;
        }
    }
}

state camera_captured_disabled {
    state_entry() {
        llListen(channel,"",llGetOwner(),"");
        llSetStatus(STATUS_PHYSICS,FALSE);
    }
    listen(integer channel, string name, key id, string message) {
        if (llToLower(message) == "follow") {
            state camera_captured;
        }
    }
}


ScriptLibrary
There is no comment on this page. [Display comments/form]