Jump to content

X Axis rotation while worn on an avatar.


Yalc Shichiroji
 Share

Recommended Posts

Ok, here's my issue. I have an oblong shield that once of my characters uses. The idea I have for the shield is that when not in use it is worn along the length of the arm, from wrist to shoulder, and when in use it swings around 90 degrees so that it lays across the arm like a normal carried shield would.

 

My question is would this be possible to achieve or would the rotation script not function properly when attached to an avatar rather than being in world?

Link to comment
Share on other sites

Assuming you want to rotate the whole apparatus through 90°, it's pretty straightforward.     Take a look at the chart in the wiki article on Rotation.

Something like this should do it:

rotation r90;default{    state_entry()    {        r90 = llEuler2Rot(<90.0,0.0,0.0>*DEG_TO_RAD);    }    touch_start(integer total_number)    {        llSetRot(r90*llGetLocalRot());        r90=ZERO_ROTATION/r90; //invert the rotation     }}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...