Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- goto(){
- // Start position
- SPOS = llGetPos();
- // End position at llGetOwner position
- vector to = prPos(llGetOwner());
- // Meters above start position to go
- float above = 3;
- // Total time of animations
- float total_time = 3;
- // Nr of keyframes
- integer steps = 10;
- // Where to go in local coordinates
- vector travel = to-SPOS;
- integer i; list out = [];
- // Previous frame position
- vector pre = SPOS;
- for(i=1; i<=steps; i++){
- // Where to go in a straight line
- vector v = travel*((float)i/steps);
- // Additinal Z to make it curve there
- float z = llSin(PI*(float)i/steps)*above;
- // Global position to go to this frame
- vector p = (SPOS+v+<0,0,z>);
- // add
- out+= [p-pre, total_time/steps];
- // Save previous frame position
- pre = p;
- }
- // Begin
- llSetKeyframedMotion(out, [KFM_DATA, KFM_TRANSLATION]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement