llSetForce(vector force, integer local);
Sets the
force to be continuously applied on the (
attached)
object. When
local is
TRUE then
force is relative to the object's own (potentially
rotated)
axes; when
FALSE it is relative to the
simulator's axes.
The object must be
physical for this to take effect. See
physics for information on how forces affect physical objects.
If you want only an impulse, use
llApplyImpulse instead.
You can also set
force and
torque simultaneously by using
llSetForceAndTorque.
Do
not use with
vehicles.
Example:
To levitate an object, apply an upwards force proportional to its mass.
Rez a
prim, enable
physics, and execute the following in a
script:
float mass = llGetMass(); // mass of this object
float gravity = 9.8; // gravity constant
llSetForce(mass * <0,0,gravity>, FALSE); // in global orientation
The
prim will now appear weightless and still possess inertia.
Note: With large/very massive objects, the object may not have enough energy to sustain the continuous force and will still fall to the ground.
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Dynamics