Jump to content

How do I make my avatar face the point it is moving towards when using "llMoveToTarget".


Vindictii
 Share

You are about to reply to a thread that has been inactive for 2391 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am using llMoveToTarget to make my avatar move from point to point. Unfortunately, when my avatar moves to the location he does not turn to face the location - he continues to face the same direction regardless of where he moves to. The script that triggers the movement is on the avatar's HUD.

I have tried several functions (llLookAt and rotation functions) but they all rotate the button and not the avatar. Is there a function that I have overlooked? 

Link to comment
Share on other sites

EIther llLookAt or llRotLookAt should work, but I suspect the problem lies in how you are using them. If you place your script in an attached item (a "button", maybe?), then those functions will rotate the attachment.  If your script is in something that your avatar is seated on, the function will turn the seat, and thus also your avatar.  You will of course then also need to get PERMISSION_TRIGGER_ANIMATION to let you make the "sit" animation stop and replace it with something that is more suitable.

Link to comment
Share on other sites

The only way I know to rotate an avatar (as opposed to a linkset on which an avatar is sitting) is with RLV's @setrot call.  So you''d need to be using a viewer with RLV enabled (i.e. not the official one) and then call llOwnerSay("@setrot:SomeAngleInRadians=force") before the llMoreToTarget call.  It's not terribly accurate but it's all that's available.

Link to comment
Share on other sites

You can't accurately read an avatar's rotation unless the avatar is sitting on something or in mouselook.  From the wiki:

Quote

llGetRot incorrectly reports the avatars rotation when called from the root of an attached object, use llGetLocalRot for root prims, instead

  • llGetRot will return an accurate facing for Avatars seated or in mouselook, but only a rough direction otherwise when called from an attached prim.
  • When called in an attachment's child prim, the reported rotation will only be visually correct if the object's root is attached to ATTACH_AVATAR_CENTER, at ZERO_ROTATION. Moving the attachment's root or changing the attachment point will not affect the reported rotation. Avatar animation is invisible to the simulator, so it also does not affect the reported rotation. Also see Single or Root Prims vs Linked Prims vs Attachments.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2391 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...