Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

"Rocker" Script

Luckee Charming
Registered User
Join date: 10 Jan 2005
Posts: 4
01-21-2005 17:08
I am looking for script to animate a swing and give it a rocking effect...any help will be most appreciated :)
Kats Kothari
Disturbingly Cute
Join date: 14 Aug 2003
Posts: 556
01-21-2005 18:25
From: Luckee Charming
I am looking for script to animate a swing and give it a rocking effect...any help will be most appreciated :)


I've seen some items inworld that use this, but I don't have any of the scripts. Some of them even use touch-start so you can control when they are rocking and when to stop. The people that post in these forums are very nice and helpful, so I'm sure you'll get the help for your script. ;)
_____________________
Maker of many kawaii items: Dolls, huggable plushies, and purses with cute critters.
Visit Kats' Kreatures for a better look and feel free to explore! =^_^=
Kats' Kreatures Gualala (140,9)


"The cat is cryptic, and close to strange things which men cannot see..."
- H.P. Lovecraft
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
01-22-2005 11:45
this is a movement i have used before to get that effect
youll will have to tweak it to work the way you want ie on/off ect....
-LW
CODE

rotation Inverse(rotation r)
{
r.x = -r.x;
r.y = -r.y;
r.z = -r.z;
return r;
}
rotation GetParentRot()
{
return Inverse(llGetLocalRot())*llGetRot();
}
SetLocalRot(rotation x)
{
llSetRot(x*Inverse(GetParentRot()));
}


vector normal = <1.5, 0.0, -1.75>;

default
{
state_entry()
{
@a;
SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z + 1>));
SetLocalRot(llEuler2Rot(normal));
SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z - 1>));
SetLocalRot(llEuler2Rot(normal));
jump a;
}

}
Luckee Charming
Registered User
Join date: 10 Jan 2005
Posts: 4
01-22-2005 14:38
tysvm :) off to the sandox to give it a try - very much appreciated!! :) :)
Tcoz Bach
Tyrell Victim
Join date: 10 Dec 2002
Posts: 973
01-24-2005 15:58
You can also just joint the swing, and have a little "pusher" script on a timer that applies a forward force. The object's natural "weight" will rock it back. I used to use this for a swing and to simulate a saloon sign getting pushed by the wind. Think the whole script was three lines long.
_____________________
** ...you want to do WHAT with that cube? **
Lance LeFay
is a Thug
Join date: 1 May 2003
Posts: 1,488
01-24-2005 18:31
I didn't know LSL had gotos.

Eew.
_____________________
"Hoochie Hair is high on my list" - Andrew Linden
"Adorable is 'they pay me to say you are cute'" -Barnesworth Anubis