# Moving Locally Outward

Please take a moment to consider if this thread is worth bumping.

## Recommended Posts

I'm trying to figure out how to move child prims outward from the center of the root based on their initial local position. I'm terrible with rotations, and I'm sure that's what this script needs to figure out the new position, so I'm not sure how to go about it. If I'm going about it all wrong, what would you suggest?

Basically, I have say, a center pillar with satellite spheres around it at varying heights. I want them to retain the height (z offset), but move outward based on a given radius along the X and Y axis. Currently what it's doing is moving them all in the same direction, which obviously isn't right

```float radius = 0.25;
float max = 1.5;
list localposdef;
default
{
state_entry()
{
integer num = llGetNumberOfPrims();
do
{
if(llToLower(name) == "ribbon")
{
}
}
while(num-- > 1);
}

touch_start(integer total_number)
{
integer num = llGetNumberOfPrims();
do
{
if(llToLower(name) == "ribbon")
{
if(~idx)
{
vector pos = llList2Vector(localposdef,idx);
}
}
}
while(num-- > 1);
}
}```

##### Share on other sites

Ha, nevermind, no rotation needed. I need to multiply the original offset by the new radius.

```float radius = 1.0;
float max = 5.0;
list localposdef;
default
{
state_entry()
{
integer num = llGetNumberOfPrims();
do
{
if(llToLower(name) == "ribbon")
{
}
}
while(num-- > 1);
}

touch_start(integer total_number)
{
integer num = llGetNumberOfPrims();
do
{
if(llToLower(name) == "ribbon")
{
if(~idx)
{
vector pos = llList2Vector(localposdef,idx);
}
}
}
while(num-- > 1);
}
}```

• 3
##### Share on other sites

Kudos for showing your own solution to your problem - and yes, logical errors always the hardest to find and solve

##### Share on other sites

Adding my own thanks for sharing, because it really helps other people later. That was thoughtful.

Worst thing in the world is when someone says "Aha! I've solved it!" and then they leave without telling anyone what the solution was... Thanks for not being one of those people!

• 3