0

I'm trying to create double doors that slide opposite ways but I want to only use a single object. Basically I'm using this script;

But I'm wondering if its possible so it separates in the middle and retracts rather than it retracting from one end? Supermarket doors would be my best example.

``//When touched the prim is retracted towards one end and when touched again stretched back out.
//
//Prim moves/changes size along the local coordinate specified in the offset vector below.
//
//To change the overall size, edit the prim when stretched out and reset the script when done. 
//
//The script works both in unlinked and linked prims.
//

 
 
vector offset = <0,1,0>; //Prim moves/changes size along this local coordinate
float hi_end_fixed = TRUE; //Which end of the prim should remain in place when size changes?          
                            //The one with the higher (local) coordinate? 
float min = 0.2; //The minimum size of the prim relative to its maximum size
integer ns = 10; //Number of distinct steps for move/size change
 
 
default {
    state_entry() {
        offset *= ((1.0 - min) / ns) * (offset * llGetScale());
        hi_end_fixed -= 0.5;
    }
 
    touch_start(integer detected) {
        integer i;
        do  llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset,
                PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
        while ((++i) < ns);           
        offset = - offset;    }
}``

0 Answers0