I want to script a simple teleporter to carry me on my parcel. So far it's only a test script. On click it's supposed to teleport me to a specific target (around 50 meters beside the position of the object). It works, but on arrival to my target position, my avi start flying all over the place for one or 2 seconds. And since I'm on the top of a skybox at 700m above ground, I flip over the edge and fall. If I set the target far away from the edge, I don't fall, but when my avi arrives to the target, he's floating (flying above the top of the skybox).
I suspect that it's because I TP up in the sky, maybe it detects that I'm above the ground and starts flying... Then, how can force my avi in a "no flying" mode once I unsit him?
Thanks in advance for your help.
Here is the script:
vector LandingStripTgt = <96,34,701>; // the Target Vector for the middle of the landing strip
default
{
// At the start of the Default state, this block of code is executed
state_entry()
{
llSetText("Simple teleporter",<255,255,255>,1); // Set the text displayed above the teleporter
}
touch_start(integer total_number)
{
vector ActualPosition = llGetPos();
llOwnerSay("TP actual position is "+ (string)ActualPosition);
vector OffsetPos = LandingStripTgt - ActualPosition;
llOwnerSay("The offset to the target is: "+(string)OffsetPos);
llSitTarget(OffsetPos,ZERO_ROTATION);
llSetSitText("Teleport"
; llOwnerSay("Teleporter activated and ready, right click and select <Teleport> to get to the destination"
;}
changed(integer change)
{
llUnSit(llAvatarOnSitTarget()); // The Avi is unsitted, because we only wanted to TP him, not sit him..
}
}
