Difference between revisions of "LlSetForce"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 11: Line 11:
|caveats=Only works on physical objects and attachments (non-physical as well as physical).  Used on an attachment, it will apply the force to the avatar.
|caveats=Only works on physical objects and attachments (non-physical as well as physical).  Used on an attachment, it will apply the force to the avatar.
|constants
|constants
|examples=<lsl>
|examples=<lsl>//A simple rocket script. Launches object up when touched.  
//A simple rocket script. Launches object up when touched.  
//Sit on it for an interesting ride!
//Sit on it for an interesting ride!
default
default
Line 18: Line 17:
     touch_start(integer i)
     touch_start(integer i)
     {
     {
         llSetPrimitiveParams([PRIM_PHYSICS, TRUE]);
         llSetStatus(STATUS_PHYSICS, TRUE);
         llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
         llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
     }
     }

Revision as of 09:00, 22 April 2009

Summary

Function: llSetForce( vector force, integer local );
0.0 Forced Delay
10.0 Energy

Applies force to the object (if the script is physical)

• vector force directional force
• integer local boolean, if TRUE uses local axis, if FALSE uses region axis.

Continuous force. llApplyImpulse has instantaneous push.

Caveats

Only works on physical objects and attachments (non-physical as well as physical). Used on an attachment, it will apply the force to the avatar.

Examples

<lsl>//A simple rocket script. Launches object up when touched. //Sit on it for an interesting ride! default {

   touch_start(integer i)
   {
       llSetStatus(STATUS_PHYSICS, TRUE);
       llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
   }
}</lsl>

See Also

Functions

•  llSetForceAndTorque
•  llSetTorque
•  llApplyImpulse Instantaneous force

Deep Notes

Signature

function void llSetForce( vector force, integer local );