Difference between revisions of "Follower script"

From Second Life Wiki
Jump to navigation Jump to search
(page created)
 
m
Line 1: Line 1:
This script was extracted from the Batman Follower v1.2.
This script was extracted from the Batman Follower v1.2, but the following distance was changed from .3m to .1m.


To set the distance between the follower and the followee, change the value denoted by # in '''llMoveToTarget(pos,#)'''. This script has it set at 10 centimeters.
To set the following distance (distance between follower and followee), change the value denoted by # in '''llMoveToTarget(pos,#)'''. This script has it set at 10 centimeters.


<code>
<code>

Revision as of 14:35, 20 May 2007

This script was extracted from the Batman Follower v1.2, but the following distance was changed from .3m to .1m.

To set the following distance (distance between follower and followee), change the value denoted by # in llMoveToTarget(pos,#). This script has it set at 10 centimeters.

default {

   state_entry()
   {
       vector pos = llGetPos();
       llSetStatus(STATUS_PHYSICS, TRUE);
       llSleep(0.1);
       llMoveToTarget(pos,0.1);
       key id = llGetOwner();
       llSensorRepeat("","",AGENT,200000,7000*PI,.4);
   }
   sensor(integer total_number)
   {
       vector pos = llDetectedPos(0);
       vector offset =<-1,0,1>;
       pos+=offset;
       llMoveToTarget(pos,0.1);     
   }

}

Note: The wiki code on this wiki is not working properly. Include the default { and the last } when copying and pasting this script into SL.