Jump to content

Child Prim not Moving


Wandering Soulstar
 Share

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

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

Recommended Posts

Hi All,

I'm having a 'problem' which I expect is just me being a bit dense, but hopefully someone can point out the errors of my ways. I have a set of sliding doors (each with their own script) that 'should' open when directed by the script in the root prim, but the child prim is not moving at all. The code used in the child prim is: llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos]), where pos is the new position it should have (world coordinates). but nothing happens at all .... I have tried as well with the actual link number .. and calling the same from the root prim .. and nothing. Each door is a single mesh piece ...

What am I doing wrong????

Thanks in advance, Wanda.

 

P.D. The position I am passing is the actual coordinates I want it at ... should I be passing coords relative to the root?

 

Edited by Wandering Soulstar
Link to comment
Share on other sites

It's hard to do more than guess without seeing the script, but as long as I am guessing ...

You are using PRIM_POSITION to move a child prim when you almost certainly want to use PRIM_POS_LOCAL .   To do it properly, you will first need to get the child prim's current local position with llGetLinkPrimitiveParams.  For example, take a look at 

 

Link to comment
Share on other sites

Does the subroutine handling the doors ever being called?  Normally handling is done by touch or more advanced sliding doors opens by proximity or by a person standing on a trigger.

Very basic sliding right opening door sample using touch :

integer bOpen= FALSE;

default
{
    state_entry()
    {
    }

    touch_start(integer total_number)
    {
        integer i;
        float d= 0.1;   // delta 10 cm
        
        bOpen= !bOpen;
        if (bOpen) d= -0.1;
        
        vector pos= llGetLocalPos();
        
        for (i=0; i<20; i++)
        {
            pos.y= pos.y+d;
            llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, pos]) ;          
        }
    }
}

Link to comment
Share on other sites

just for the heck...

vector scale;
default
{   
    state_entry()
    { scale = llGetScale(); 
    }
    touch_start(integer total_number)
    { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,llGetLocalPos()+< 0,(scale.y = -scale.y ),0>]);          
    }
}

 

Edited by Xiija
Link to comment
Share on other sites

Quote

You are using PRIM_POSITION to move a child prim when you almost certainly want to use PRIM_POS_LOCAL .

Yes. It's not the coordinate system. It's that

llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos])

does nothing in a child prim. The documentation does not indicate this. It probably should.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2056 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...