I'm using this code to have an object float above my head and stay there as i walk around and trying to have it rotate on z-axis 360 degees continuously.
startFollowing() {
llSetStatus(STATUS_PHANTOM, TRUE);
llSensorRepeat("", llGetOwner(), AGENT, 10.0, PI,1.0);
followMe = TRUE;
llTargetOmega(<0.0, 0.0, 1.0>, 1.0, 0.001);
currentPos = llGetPos();
currentRot = llGetRot();
llSay(0, "Start Following");
}
stopFollowing() {
followMe = FALSE;
llTargetOmega(<0.0, 1.0, 0.0>, 0.0, 0.1);
llSay(0, "Stop Following Me");
llMoveToTarget(currentPos,0.4);
llSetTimerEvent(2.0);
}
timer() {
llSetStatus(STATUS_PHANTOM, FALSE);
llSensorRemove();
llSetTimerEvent(0);
}
sensor(integer total_number) {
if (isLoggedOn) {
vector pos = llDetectedPos(0);
rotation rot = llDetectedRot(0);
vector offset =<0,0,1.8>;
pos+=offset;
llMoveToTarget(pos,0.4);
}
}
The object is moving from the ground above my head perfectly and back again on stop, but it seems that the llTargetOmega to rotate the object above my head doesn't want to work with llMoveToTarget?
Any help would be appreciated.