|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
05-16-2007 16:19
I recently read a post here that was able to answer my questions and help me out with a scripting question that I had. However I am looking at adding llRotLookAt or the like. sensor(integer total_number) { if (found == 1 && OnOff == 1) { vector holder = llDetectedPos(0); // Agent bound to the script if(llVecMag(llGetPos() - holder) > distance) { llMoveToTarget(holder + (distance * llVecNorm(llGetPos() - holder)),0.3); // Move to llGetOwner() position llRotLookAt(holder, strength, damping); // Rotate to look at Collar Owner llSleep(time / 4.0); llStopMoveToTarget(); // Stop Movement to prevent stacking llStopLookAt(); // Stop Rotation " " " } } }
(the strength and damping variables are specified globally) Now the llMoveToTarget works fine and how I want it to. Now doing research on the wiki I found that llRotLookAt is the best thing for physical objects. I have read over the information in regards to llRotLookAt but I for some reason cannot seem to get the scripting to work. I think I do not fully understand the explination on how it works in regards to the strength and damping. Could someone explain this to me? Or show how I could get this working?
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-16-2007 16:39
Just a guess, but are you trying to use this in an attachment to make the avatar face a particular direction?
If so, it clearly states in the Wiki that it does not work in attachments. There is llPointAt, which is *supposed* to do this, but it has been broken for a long long time (since beta).
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
05-16-2007 16:59
From: Talarus Luan Just a guess, but are you trying to use this in an attachment to make the avatar face a particular direction? That is what I was looking for, but I also do know that it doesnt work on attachments. However for testing purposes it would still be nice to have the tested object move and face. So yes, I know that it won't rotate an avatar. But that wasn't my question.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
05-16-2007 17:11
Does it rotate at all?
Something you might try:
llRotLookAt(llGetRot() * llRotBetween(<1,0,0> * llGetRot(), holder- llGetPos()), strength, damping);
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
05-16-2007 17:44
Isn't there one to many arguements in that function? I have tried something like that but it keeps stating syntax error, or invalid type. both the strength and damping are globally set to float variables. float strength = 1.0; float damping = 1.0;
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
05-16-2007 17:47
Try copying and pasting - should work fine.
Tinkering with damp and strength should affect the dynamics of the rotation (speed and such).
|