Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sensor question

Rizado DaSilva
Merchant
Join date: 12 May 2005
Posts: 30
01-18-2006 15:44
hey there, I have a script in which I am sending a:

llSensorRepeat("",item_key,SCRIPTED,96,TWO_PI,1);

which works fine and pulls my item to the item_key item as long as the other item_key item is free standing, however, if I am holding the item_key item the sensor stops working and won't pull. It's driving me nuts. What do I have to do to fix this?

CODE
if(lPull) {
vector pull = llDetectedPos(0);
if(llVecMag(llGetPos() - pull) > lLong) {
vector dif = llGetPos() - pull;
float range = llVecMag(dif);
float adj = lLong / range;
dif = dif * adj;
llSetPrimitiveParams([PRIM_PHYSICS,TRUE]);
llMoveToTarget(pull+ dif,.4);
llSleep(0.1);
llStopMoveToTarget();
llSetPrimitiveParams([PRIM_PHYSICS,FALSE]);
}
}

Thanks in advance
=Riz
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
01-18-2006 18:41
yes, because an attached item is part of your AV. at that point llEmails or llWhisper/Say/Shout are the only way for an attachment to be found/heard/known.
<from the Wiki>
When used in an object attached to an avatar, it will always return the position of the avatar's center in region coordinates, though child objects in attachments will return the position of the child.
</wiki>
so remember that when moving your following object.

L8r,
UU
_____________________
Rizado DaSilva
Merchant
Join date: 12 May 2005
Posts: 30
01-18-2006 22:23
Yes, thanks, got it, so I sent the item_key to the particle code and the physics to the av key and it all werks. Thanks!