Last active
April 6, 2017 13:20
-
-
Save masterpoppy/5ac24ff9b570a2e8e97dac510a63e661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integer i = 1; | |
vector target; | |
vector dest; | |
integer handle; | |
list point = [ | |
<3,0,0>, | |
<0,3,0>, | |
<-3,0,0>, | |
<0,-3,0> | |
]; | |
update() | |
{ | |
llLookAt(llGetPos() + <0,0,1>, 1, 0.1); | |
llStopMoveToTarget(); | |
target = llList2Vector(point, i); | |
llTargetRemove(handle); | |
dest = llGetPos() + target; | |
handle = llTarget(dest, 0.1); | |
llMoveToTarget(llGetPos() + target / 0.37, 5); | |
i++; | |
i = i % 4; | |
} | |
default | |
{ | |
state_entry() | |
{ | |
llSetVelocity(ZERO_VECTOR,FALSE); | |
llTargetRemove(handle); | |
llStopMoveToTarget(); | |
} | |
touch_end(integer index) | |
{ | |
update(); | |
} | |
at_target(integer tnum, vector targetpos, vector ourpos) | |
{ | |
update(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment