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

LSL Wiki : llPushObject

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl814.us.archive.org
llPushObject(key id, vector impulse, vector angular_impulse, integer local)

Applies impulse and angular_impulse to object or avatar id.

local is a boolean (TRUE/FALSE) value that specifies whether or not the push is relative to id's rotation. If local is FALSE, whatever or whomever you're trying to push will move in the same direction, regardless of the target object/avatar's rotation.

llPushObject is not relative to the rotation of the prim containing your script.
llPushObject only works on avatars and physical objects.

A heavier (more massive) object will move another object more than a lighter object with the same impulse applied. Similarly, a heavier object, when being pushed, will not go as far as a lighter object with the same impulse. To have an object push different-sized objects at the same speed, multiply impulse by the mass of the object being pushed. llGetObjectMass can be used to obtain the mass of an object or avatar anywhere within the same sim.

There is no upper range limitation, but falloff is calculated by 1/r³: the further this object is from id, the weaker the push will be. The push will fall off proportional to the cube of the distance (radius) between the two objects.

Use this to calculate and counteract the falloff on a push:
Power*llPow(llVecDist(llGetPos(), TargetPos), 3);

Q: Does multiplying the velocity by the mass of the target also make up for the difference bettwen small and large pushers?


In practice it looks like vector impulse numbers over 2147483647 will push to a lesser degree even zero push (integer maximum -- curious!). I know at some stage in the past LL limited how hard llPushObject pushed; maybe they chose the integer maximum as a cutoff. Of course this doesn't stop you using multiple llPushObjects. ;) -Psyke Phaeton

Q: When using this function on an attachment is the mass of the pushing object used (larger object greater push) or the mass of the avatar?
A:

Q: It seems when I use this call this function in a mega prim it doesn't work. I'm using the exact same script that works fine in a normal 10x10x10 so is this on purpose, or can you think of another reason why it wouldn't work?
A:

Note that using this function to grief other users will result in an abuse report being filed. If you want to remove someone from your land, use llEjectFromLand. llPushObject is not to be used for that.

As of version 1.11.1 (1) of Second Life, pushing can be set to "restricted" on a parcel by the land owner. This stops llPushObject from being used upon avatars other than the owner of the script (self-pushing is still allowed). Scripts owned by the land owner can still use llPushObject on any avatar, and pushing of non-avatar objects is unaffected.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Dynamics | Force | Impulse
Comments [Hide comments/form]
I can't get this function to work on an avatar, also (Im sure a dumb question) what is the r variable in 1/r^3?
-- AndreylSatyr (2004-06-08 01:51:00)
radius (that is, distance).
-- WednesdayGrimm (2004-06-08 14:33:53)
Pushing avatars: as far as I can tell it is intermittent as to if it pushes or not, and it seems worse if the avatar is standing still versus already moving. This isn't about the object running out of energy, checked that...
-- SeifertSurface (2005-07-20 02:03:11)
Seems to work better if the avatar is inside a phantom object that's doing the pushing, perhaps that's the falloff somehow.
-- SeifertSurface (2005-07-20 02:26:19)
according to Annoyances/Gotchas this function doesnt effect avatar rotation. If this is true, what does angular_impulse do?
-- SchitsoMonkey (2005-08-06 16:26:51)
Well, when you're using the function to push something that's not an avatar (yes, it can be used that way) it can affect its rotation if its physical.
-- ChristopherOmega (2005-08-06 23:50:01)
Ok, so what would I use if I wanted the push to have the same power no matter the distance?
-- SchitsoMonkey (2005-08-30 12:46:07)
You would figure out the falloff, and compensate for it.
-- KeknehvPsaltery (2005-08-30 13:40:05)
Ok, so what would the formula be? Something like r^3/1 ?
-- SchitsoMonkey (2005-08-30 13:56:34)
"There is no upper range limitation, but falloff is calculated by 1/r: the further this object is from id, the weaker the push will be. The push will fall off proportional to the cube of the distance (radius) between the two objects."

RTFW
-- KeknehvPsaltery (2005-08-30 14:37:21)
Yeah, so to negate 1/r^3, shouldn't I use r^3/1??
-- SchitsoMonkey (2005-08-30 14:55:37)
Oh, that's what you were getting at. That sounds about right.
-- KeknehvPsaltery (2005-08-30 15:03:02)
Ok, thanks.
-- SchitsoMonkey (2005-08-30 15:18:31)
Wow, that is WAY too strong. All im doing is multiplying the force i want to apply by llPow(llVecDist(llGetPos(),targetpos),3); Did I get the numbers wrong?
-- SchitsoMonkey (2005-09-05 18:33:18)
Dont get this, why do they allow us to push other avitars when it comes back and bites us in the ass with an Abuse Report filed against us.... But i love this dearly but i almost got in trouble because of it....
-- JakeBailly (2005-12-04 10:38:17)
It can be used on avatars for more than just griefing (I use it as a lift tube, for example).
-- DolusNaumova (2005-12-26 09:12:45)
Does anyone know how much the mass of the object using llPushObject affects the strength of the push?
-- AlkenanK (2006-03-02 14:42:41)
Chad... THANK YOU! I've been having quite a fun time with this now that I can actually control the pushes! xD
-- SchitsoMonkey (2006-03-05 09:35:10)
Alkenan - the mass of the object is directly related to how much of an energy hit it can take. llPushObject uses a pretty significant amount of energy, depending upon how far away the object is from the pusher and the force of the push. If llPushObject doesn't use ALL of the object's energy, it will exert a force that matches the parameters you send to it. If and only if it uses all the energy, will the push be weakened. This goes for both small and large objects calling llPushObject - smaller objects would just (theoretically) have a smaller amount of energy to draw from.

Complete documentation for energy is something we're all still waiting for. I dont expect it to be done anytime by LL, because they use it to control the effects of certain functions (apparently regardless of the fact that the security through obscurity mentality is flawed).
-- ChristopherOmega (2006-03-07 13:55:56)
To make sure the push gets full power, I usually just make the object phantom, invisible, (and non-physical), then set its scale to <10,10,10>, call the push, then change it back to how it was before.
-- SchitsoMonkey (2006-03-10 06:26:50)
I'm trying to help an avatar out of a chair. I first thought 'integer local' was making 'vector impulse' relative to the chair's rotation, but now see that it only deals with 'key id's rotation. In order to always get the avatar pushed towards the front of the chair, do I have to push relative to the rotation of the chair myself, and applying impuls accordingly. Or is there an llEasy() for this?
-- HaraldNomad (2006-03-16 07:38:37)
Yup, you have to basically push relative to the rotation of the chair. It isnt too hard to do this though try this:
<1,0,0> * llGetRot() * llGetMass()
This should give the avatar an initial velocity of 1m/s on the chair's local x-axis. This velocity will decay very quickly due to friction however, so you may want to set it to a greater value.
-- ChristopherOmega (2006-03-17 09:51:34)
Thanks, Chris. Since it's only meant to help a 60yo out of a chair like a 20yo, I built the 'vector impulse' with x and y dependent on the rotation of the object, a little z-push makes decades in age difference! Had to increase the push some more for rocking chairs, being too lazy to check what rotation the chair is in at the time of stand-up ;)
-- HaraldNomad (2006-03-20 04:52:28)
Ok... I have NO idea what I'm doing wrong... all I want the following script to do is stop an object dead in it's tracks:

vector force = llDetectedVel(x);
force *= llGetObjectMass(llDetectedKey(x));
force *= llPow(llVecDist(llGetPos(), llDetectedPos(x)), 3);
llPushObject(llDetectedKey(0),-force,ZERO_VECTOR,FALSE);

But it always seems to be way to weak. Any suggestions?
-- SchitsoMonkey (2006-05-24 18:53:31)
Consider that the detected object may have travelled further away from the pusher, by the time the llPushObject's impulse is applied?
-- AngelaSalome (2006-05-25 00:07:40)
I considered that, but I think the difference wouldn't cause as significant a difference in velocity as I've observed.
-- SchitsoMonkey (2006-05-25 15:33:08)
What is the maximum radius wherein falloff is not counted? Is there no falloff if the to-be-pushed objects are within a certain range of the task?
-- DavidGall (2006-06-23 09:00:50)
The line:
"llPushObject(llDetectedKey(0),-force,ZERO_VECTOR,FALSE);"

Should read:

llPushObject(llDetectedKey( x ),-force,ZERO_VECTOR,FALSE);

Shouldent it?
-- 217.157.128.147 (2007-07-26 19:03:32)
Attach a comment to this page: