I have the following bit of code in a hud although I've also tried it in an attachment. Everything works fine with the exception of the llMoveToTarget call. My av doesn't move at all. If I move the my AV manually to the target the at_target event fires correctly (I'm going to replace at_target with collision).
CODE
state kiss
{
state_entry() {
avFindName = TRUE;
llSensor( "", NULL_KEY, AGENT, sensorDistance, PI );
}
on_rez( integer startcode ) {
llResetScript();
}
sensor(integer total_number) {
if ( avFindName ) {
integer i;
for ( i = 0; i < total_number; i++ ) {
if (llDetectedName(i) == avTarget && llDetectedKey(i) != llGetOwner() ) {
avName = llDetectedName(i);
llWhisper(0, "You have offered to kiss " + avName + "." );
llMessageLinked( LINK_THIS, linkChannel, linkStringRequest, llDetectedKey(i) );
avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );
avKey = llDetectedKey(i);
return;
}
}
}
else {
avPos = llDetectedPos(0);
targetID = llTarget(avPos, 0.5);
llMoveToTarget(avPos, 0.2);
}
}
at_target(integer tnum, vector targetpos, vector ourpos)
{
llTargetRemove(targetID);
llStopMoveToTarget();
...
Any ideas as to why the llMoveToTarget is failing?