Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation Problems

Dawn Kayor
Registered User
Join date: 18 Apr 2009
Posts: 7
04-21-2009 02:09
Hello, I've made a little thing that I want to rotate correctly no matter the direction its facing. I figured out how to get it to look at the direction its facing, but figuring out how to get it to correct itself automatically is something I don't know how to do.

For instance I want to rotate it to 45 degrees, right now I have to click it to get it to correct itself.

I don't know what to look for as far as documentation goes on how to do this. Can somebody help with a place to go to on how to do this?

Thank you

CODE

default
{
state_entry()
{
llTargetOmega(<0,0,0.1>*llGetLocalRot(),PI,1);
}

touch_start(integer total_number)
{
llResetScript();
}
}
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
04-21-2009 02:29
You'll need to take out the root rotation, which is why it goes wrong when you rotate the object away from <0,0,0>:

llTargetOmega(<0,0,0.1>*llGetLocalRot()/llGetRootRotation(),PI,1);