Jump to content
Wandering Soulstar

Child Prim not Moving

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

Share this post


Link to post
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 

 

Share this post


Link to post
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]) ;          
        }
    }
}

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...