Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problem with linked object rotation

Ludovico Dover
Registered User
Join date: 1 Dec 2008
Posts: 11
12-04-2008 08:31
Hi to everyone!
I'm starting now to learn lsl and I have a "big" problem. Thanks in advance for your time and help!

I'm trying to build a bar that rotates when you push 1 of two buttons. A total of 3 prims, linked togheter:

bar= root
button ON= child
button OFF= child

But when I click on 1 button, all the linkset is rotating...How can I make the 2 buttons fixed and only the bar rotating? Is it possible? Below my simple code (I know that I have to add something else, but I don't know very well...)

CODE

default
{
touch_start(integer X)
{
string button = llGetLinkName(llDetectedLinkNumber(0));
if (button=="ON")
{
llSetText("I'm rotating!", <0,1,0>, 1.5);
llTargetOmega(<0,10,0>,PI/6,1);
}
else if (button=="OFF")
{
llSetText("Stopped",<1,0,0>, 1.5);
llTargetOmega(<0,0,0>,PI/6,1.0);
}
}
}


Thank you very much for your help and your time !

Ludo
Ee Maculate
Owner of Fourmile Castle
Join date: 11 Jan 2007
Posts: 919
12-04-2008 08:40
http://rpgstats.com/wiki/index.php?title=LlTargetOmega

You need to make sure that the rod isn't the root prim of the linkset but one of the children.
Ludovico Dover
Registered User
Join date: 1 Dec 2008
Posts: 11
12-04-2008 09:03
From: Ee Maculate
http://rpgstats.com/wiki/index.php?title=LlTargetOmega

You need to make sure that the rod isn't the root prim of the linkset but one of the children.


But the problem is that the Rod has to be linked as root with the 2 buttons, using this code(maybe it's not the correct one...).
In this case when you click ON or OFF it should start rotating...
Ludovico Dover
Registered User
Join date: 1 Dec 2008
Posts: 11
Problem solved
12-05-2008 08:20
Problem solved! Thanks. below the script, if you need it:
/54/8a/296214/1.html#post2244793