# Find the Rotation of a Child Link

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

## Recommended Posts

Hello, i have seach but no luck,

i need to be able to find in all the links prims the rotation, to fix it in case is move

if i have 80 prims linked and some of them the rotation has move i like to seach in all the links which are the one are move so i can fix it (maybe with same script will be great)

here is and example of 4 prims and one is move rotation, i need to be able to find using a script

Thanks so much for any help

##### Share on other sites

The function you want is llGetLinkPrimitiveParams

##### Share on other sites

yes i found that but for some reason i can get the rotation like the image

z=39 degrees

i need some sample script

thanks so much

##### Share on other sites

here is an idea of what you might do?

```list rot_list;

check_prims()
{     rot_list = [];
integer prims=llGetNumberOfPrims();
integer x;
for(x = 1; x <= prims;++x)
list temp = llGetLinkPrimitiveParams(x,[ PRIM_ROT_LOCAL ]  );
rotation r = llList2Rot( temp,0);
rot_list += r;
}
}
compare_lists();
{ // make a function to compare list elements, and return TRUE or FALSE
}
reset_rotations()
{ // make a function to reset all rotations
}
list start_rotations;
list chk_rotations;

default
{
state_entry()
{  check_prims();
start_rotations = rot_list;

}
touch_start(integer total_number)
{   check_prims();
chk_rotations = rot_list;
integer status = compare_lists();

if( status )
llOwnerSay("rotations correct");
else
reset_rotations();
}
}```

##### Share on other sites

thanks i will try this thanks again!

##### Share on other sites

The check_prims() return this and not in Degres how can i conver this?

thanks

```Hello, Avatar!
[18:46] Object: Link # 1 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>
[18:46] Object: Link # 2 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>
[18:46] Object: Link # 3 Rotation: <0.00000, 0.00000, 0.33381, 0.94264>
[18:46] Object: Link # 4 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>```

##### Share on other sites

vector     euler = llRot2Euler( some_rot ); // change rotation to vector

`euler *= RAD_TO_DEG;// change vector to degrees`

Edited by Xiija

thanks!

##### Share on other sites

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

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.