
Put the following code inside a prim...
CODE
default
{
state_entry()
{
llSitTarget(<0,0,1>,ZERO_ROTATION);
}
touch_start(integer num_detected)
{
llSetPos(llGetPos() + <0,0,5>);
}
}
When you sit on the prim, then touch it, the prim and avatar move up 5 meters. Now make another prim and add the similar code (But adjusted for Child Prim status)...
CODE
default
{
state_entry()
{
llSitTarget(<0,0,1>,ZERO_ROTATION);
}
touch_start(integer num_detected)
{
llSetPos(llLocalGetPos() + <0,0,5>);
}
}
or
CODE
default
{
state_entry()
{
llSitTarget(<0,0,1>,ZERO_ROTATION);
}
touch_start(integer num_detected)
{
llSetPos(<0,0,5>);
}
}
I know the effect of the two scripts isn't the same, but was just troubleshooting to see if llGetLocalPos() was the problem. Anyways, link the two prims together with the original as the parent.
Sitting on the Parent object still produces the desired results, prim and avatar moving up 5 meters. The child prim also moves up 5 meters now.
Now sit on the child prim. When you touch the Parent object, the desired results happen. The parent prim, child prim (and agent on child prim) both move up 5 meters.
When you touch the Child object however, just the Prim will move up 5 meters. The agent stays floating in the air.
The only cause for this than I can think of is the llSitTarget behaving incorrectly. When used in a child prim, I think it must take on the form of llSitTarget(llGetLocalPos() + OFFSET) and be calculated based on the Parent Prim.
Bug?
Thanks,
FireEyes Fauna