Wandering Soulstar Posted September 3, 2018 Share Posted September 3, 2018 (edited) 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 September 3, 2018 by Wandering Soulstar Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 3, 2018 Share Posted September 3, 2018 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 More sharing options...
Rachel1206 Posted September 3, 2018 Share Posted September 3, 2018 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 More sharing options...
Wandering Soulstar Posted September 3, 2018 Author Share Posted September 3, 2018 Thanks for the responses! Tuns out the problem was that I was using global positions instead or positions relative to the root. 1 Link to comment Share on other sites More sharing options...
Xiija Posted September 3, 2018 Share Posted September 3, 2018 (edited) 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 September 3, 2018 by Xiija Link to comment Share on other sites More sharing options...
animats Posted September 9, 2018 Share Posted September 9, 2018 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 More sharing options...
Recommended Posts
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