if(msg=="Down"

{
NewPos=llGetRootPosition() +<0,0,20>;
llOwnerSay((string)NewPos);
llSetPos(NewPos);
}
if(msg=="Up"

{
llSetPos(llGetRootPosition() +<0,0,26.52>
;}
Thanks in advance

These forums are CLOSED. Please visit the new forums HERE
Having a problem with llSetPos |
|
|
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
|
08-25-2008 04:24
I'm trying to move a child prim between 2 different positions using the parent prim as a reference incase the script gets reset or the prim moved acidentally but the prim won't move, even though the llOwnerSay indicateds changing Coordinates.
if(msg=="Down" ![]() { NewPos=llGetRootPosition() +<0,0,20>; llOwnerSay((string)NewPos); llSetPos(NewPos); } if(msg=="Up" ![]() { llSetPos(llGetRootPosition() +<0,0,26.52> ;} Thanks in advance ![]() _____________________
Level 38 Builder [Roo Clan]
Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107) Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107) |
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
08-25-2008 04:42
I believe llSetPos is limited to moving 10m at a time. Try reducing your movement to just below 10m, and see if it works.
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
08-25-2008 07:28
Not sure how child prims behave but if you try to llSetPos an object more than 10m, it won't ignore it - it'll just move 10m then stop..
edit: wiki says "Movement is capped to 10m per call for unattached root prims" which sounds like a > 10m move on a child may indeed just get ignored. _____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
08-25-2008 10:44
You didn't say it but I kinda understand that the script is supposed to be in the child prim.
In that case, llSetPos() is already relative to root position. When you add llGetRootPosition(), its value is used as offset to (try to) send the child prim that far away from the root. There is something in SL called "linkability limit". If you try to move a child too far from its parent, it will just refuse. Your script should looks like this: if (msg == "Down" ![]() { NewPos = <0.0, 0.0, 20.0>; llOwnerSay((string)NewPos); llSetPos(NewPos); } else if (msg == "Up" ![]() { llSetPos(<0.0, 0.0, 26.52> ;} And don't forget the "else if"! It will work... If the root and the child have a volume of 10m x 10m x 10m... or maybe a little smaller. 20m is a very large distance in between a child and its parent! |
|
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
|
08-25-2008 12:45
You didn't say it but I kinda understand that the script is supposed to be in the child prim. In that case, llSetPos() is already relative to root position. When you add llGetRootPosition(), its value is used as offset to (try to) send the child prim that far away from the root. There is something in SL called "linkability limit". If you try to move a child too far from its parent, it will just refuse. Your script should looks like this: if (msg == "Down" ![]() { NewPos = <0.0, 0.0, 20.0>; llOwnerSay((string)NewPos); llSetPos(NewPos); } else if (msg == "Up" ![]() { llSetPos(<0.0, 0.0, 26.52> ;} And don't forget the "else if"! It will work... If the root and the child have a volume of 10m x 10m x 10m... or maybe a little smaller. 20m is a very large distance in between a child and its parent! WOOT!, that got it, thx _____________________
Level 38 Builder [Roo Clan]
Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107) Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107) |
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
08-25-2008 13:15
In that case, llSetPos() is already relative to root position. Ack! Can't believe I fell for that one. Again. _____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-25-2008 13:21
Not sure how child prims behave but if you try to llSetPos an object more than 10m, it won't ignore it - it'll just move 10m then stop.. edit: wiki says "Movement is capped to 10m per call for unattached root prims" which sounds like a > 10m move on a child may indeed just get ignored. Not only that, but moving beyond the link distance limit can also fail with no movement. |