Jump to content

Smooth child prim movement?


Altier Verwood
 Share

You are about to reply to a thread that has been inactive for 716 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello again forum, I have another question I wasn't able to find an answer to, I'm writing a script that will in theory, slowly move a child link in a random direction then reset slowly back to the original position.

but I have run into two problems, first is the movement is not slow it just snaps to the location and the second problem, is I can't get it to save the original position to move back to, instead it just keeps moving farther away. any help would be greatly appreciated. 

integer k;
vector pos;
rotation rot;
vector opos;
float ds = 1; //debris size SMALLER
float rs = 2; //debris random size BIGGER
default
{
    state_entry()
    {
            llSetTimerEvent(2.0);
            opos= llGetPos();
    }
    timer()
    {
        for(k=0;k<rs;++k)
        {
            llSleep(.1);      
            pos = llGetLocalPos();
            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION, pos+<(llFrand(rs))-ds,(llFrand(rs))-ds,(llFrand(rs))-ds>*rot]);
//llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION, opos*rot]);
        }
                for(k=0;k<rs;++k)
        {
            llSleep(.1);      
            pos = llGetLocalPos();
            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION, opos*rot]);
    }
        
    }
}
 

Link to comment
Share on other sites

unfortunately your first problem isn't (easily/efficiently) solvable with LSL. you can't make a child prim move smoothly, you can only spin it smoothly with omega.

as for the second, you should be able to figure it out if you think through your logic enough ;)

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 716 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...