Persephone Sorbet
Registered User
Join date: 2 Jul 2008
Posts: 1
|
12-18-2009 18:58
Hi all. I am working on creating a set of doors using the Multi User Lockable Door script, found at : /54/22/24116/1.html . I have been experimenting and testing for hours, trying to make it into a sliding door instead, with no luck. Can anyone help me out?
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-18-2009 19:48
set a local offset, apply the LOCAL rotation of the prim to it without modifying it, and then reverse that offset. when you go to apply it again, it'll be reversed and go back where it was... ALWAYS use local rotation to do this, and you'll never have to track changes in the global rotation. example vector gPosSlide = < 1.0, 0.0, 0.0 >; //-- the offset amount to move
default{ touch_start( integer vIntNull ){ llSetPos( llGetLocalPos() + gPosSlide * llGetLocalRot() ); gPosSlide = -gPosSlide; //-- or replace the previous 2 lines with... // llSetPos( llGetLocalPos() + (gPosSlide = -gPosSlide) * llGetLocalRot() ); } }
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|