Similar to the AnkleLock, we can create a script and an animation that locks wrists in order to replace the default avatar hands with primitive sculpted hands. This ensures that once you attach an object to your hand, the object will not move.
I have kept the script as minimal as possible with an rolled-out version and an optimized version which you could use for production. In other words, the rolled-out version is for you to see how this works and the optimized version is the one you should use. I have created both the script and the animation for the hands.
[K] WristLock - Animation.bvh
somewhere on your desktop or wherever you place your files.[K] WristLock - Animation.bvh
file.
The only setting that may vary between servers and viewers is the animation priority. Ideally, the higher the priority the better so the animation priority should be set at the maximal value you can set it to. In this case, the priority is 5
, if the settings will not let you to set it to 5
, the next highest value will do. You can leave the rest of the settings at their default values. However the settings above are mandatory including the name.
[K] WristLock - Controller
.The shoe you picked should now contain two files:
[K] WristLock - Animation [K] WristLock - Controller
where [K] WristLock - Animation
is the animation you just uploaded and [K] WristLock - Controller
is the script from below.
/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// default { state_entry() { llRequestPermissions(llGetOwner(),16); } on_rez(integer start_param) { llRequestPermissions(llGetOwner(),16); } run_time_permissions(integer perm) { if ((perm & 16)) { llStopAnimation("[K] WristLock - Animation"); llStartAnimation("[K] WristLock - Animation"); llSetTimerEvent(1.175494351E-38); } } timer() { llSetTimerEvent(0); llRequestPermissions(llGetOwner(),16); } }
/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } on_rez(integer start_param) { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation("[K] WristLock - Animation"); llStartAnimation("[K] WristLock - Animation"); llSetTimerEvent(1.175494351E-38); } } timer() { llSetTimerEvent(0); llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } }