Amichai Shamen

Trigger for llSetpos and ll Setrot in an attached item?

Recommended Posts

Hi All!

So I am trying to create a hand-held, multi-part item, with a few moving parts. I would like the position of two of the components to change when the item is clicked, or when the mouse is clicked when in mouselook. How can I use the llSetpos and setrot commands when the item will be moving with the avi that it is attached to?

Cheers!

-Ami

Share this post


Link to post
Share on other sites

When you use llSetPos and llSetRot in attached objects, they are treated as local motions relative to the attachment point, not as regional movements.  When you write your script, therefore, all you have to do is make all your motions in that local frame of reference.  Frankly, although that sounds easy, it often it not, especially if you have child prims in the object that must move or rotate relative to the root.  The best solution is often the most pragmatic one: bypass all of the calculations and simply store all of the possible positions and rotations that your objects will make as hard-coded values in lists in your script. Then write the script to make the appropriate changes between those "preset" stored values.  That strategy not only saves you some major headaches in scripting but also gives you a more stable result in the end.  Your object will always be moving and rotating to the same exact positions and rotations each time, rather than possibly dealing with accumulated calculation errors.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now