Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question - llTargetOmega on Child prim

Nieve Thor
Registered User
Join date: 11 May 2008
Posts: 41
09-08-2008 21:36
I used llTargetOmega function for a Child prim where the script reside on the child prim itself. It works fine. The problem is I want to make the script stop and start on touch when I tpuch the object. I found out the script won't behave as I want it, eventhough I click on the child prim itself.

Some script suggest on using llSetLocalRot but my object has 4 prims and I only want to rotate just that 1 particular prim.

I really need help.
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
09-09-2008 06:12
A touch() event in a child prim will only report the touches on this child. You must split your script in 2. The targetOmega in the child and the touch() in the root, which will send a link message.

Child script
-------------------------------------------
default
{
link_message(integer sender, integer spin, string msg, key id)
{
llTargetOmega(<0.0, 0.0, 1.0> * (float)spin, 1.0, 1.0);
}
}

-------------------------------------------

Root script
-------------------------------------------
integer Spin = FALSE;

default
{
touch(integer num)
{
Spin = ! Spin;
llMessageLinked(LINK_ALL_OTHERS, Spin, "", "";);
}
}
-------------------------------------------

It should work. But I don't guaranty how the child will spin. I lost track of the bugs, debugs and re-bugs of llTargetOmega() a long time ago...
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-09-2008 06:18
Child script
-------------------------------------------
From: someone
default
{
link_message(integer sender, integer spin, string msg, key id)
{
llTargetOmega(<0.0, 0.0, 1.0> * (float)spin * llGetLocalRot(), 1.0, 1.0);}
}


-------------------------------------------

the local rotation call insures that it always spins on the prims local axis no matter which way the object is rotated
Nieve Thor
Registered User
Join date: 11 May 2008
Posts: 41
09-09-2008 09:02
thanks..it's working perfectly :D