Rotation Script

Creating scripts
Post Reply
User avatar
Geoff Quinnell
Posts: 39
Joined: Sun Jul 28, 2013 10:35 am
Has thanked: 15 times
Been thanked: 64 times

Rotation Script

Post by Geoff Quinnell » Sun Sep 08, 2019 11:35 pm

Hi all... I have a basic slow rotation script...

default
{
state_entry()
{
llTargetOmega(<0,0,1>,0.1,1.0);
}
}

But I would like to amend it to stop at a set time period (like a pause in the rotation) at each quarter... 0 /90 / 180 / 270 degrees

Would anyone know how this can be achieved?
Thank you for any help offered :)
Geoff
These users thanked the author Geoff Quinnell for the post:
Ilan Tochner
Graham Mills
Posts: 999
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 610 times
Been thanked: 758 times

Re: Rotation Script

Post by Graham Mills » Mon Sep 09, 2019 10:32 am

Don't script much these days but something like this might work -- change the float values to suit (the first one is the time taken for rotation, the second is the delay between rotations). NB modified from continuous script example at http://wiki.secondlife.com/wiki/LlSetKeyframedMotion.

Code: Select all

default
{
    touch_start(integer total_number)
    {
        llSetKeyframedMotion([llEuler2Rot(<0.0,0.0,90.0>), 5.0, ZERO_ROTATION, 2.0],[KFM_DATA,KFM_ROTATION, KFM_MODE,KFM_LOOP]);
    }
}
These users thanked the author Graham Mills for the post (total 3):
Ilan TochnerGeoff QuinnellShandon Loring
User avatar
Geoff Quinnell
Posts: 39
Joined: Sun Jul 28, 2013 10:35 am
Has thanked: 15 times
Been thanked: 64 times

Re: Rotation Script

Post by Geoff Quinnell » Mon Sep 09, 2019 5:31 pm

Thank you Graham... I'll give that a go when I am next in :)
Cheers
Geoff
These users thanked the author Geoff Quinnell for the post:
Graham Mills
User avatar
Shandon Loring
Posts: 853
Joined: Sat Oct 26, 2013 3:25 am
Has thanked: 549 times
Been thanked: 914 times
Contact:

Re: Rotation Script

Post by Shandon Loring » Mon Sep 09, 2019 8:09 pm

Very Elegant Graham!
Nicely done!!
These users thanked the author Shandon Loring for the post:
Graham Mills
Post Reply