Jump to content

RotateOnSit


texigor
 Share

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

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

Recommended Posts

I have seen a script that rotates a avatar on sit, but I would like to slow that rotation down. I am trying to use llSitTarget(ZERO_VECTOR,ZERO_ROTATION); and do a slow rotation of the avatar on the Z-axis but with no luck in finding an example on how this is done.

 

Link to comment
Share on other sites

I would assume that the script you saw is probably using one of the llSetLinkPrimitiveParams functions to update the orientation of the avatar once they sit (since avatars are considered part of the linkset when they sit on an object). From my own experience, single use of the function in this case will cause the avatar to snap to the new orientation, sometimes with the viewer showing you a tiny bit of interpolation - though I wouldn't depend on that to be consistent.

If you want to have the effect of a slower swivel from the sit target to a new orientation, one approach would be to divide up the rotation into parts and call llSetLinkPrimitiveParams (or llSetLinkPrimitiveParamsFast ) multiple times, each one using a portion until you get to the desired final orientation. How many steps you divide this up into and what (if any) delays you use between each step will affect how smooth it looks. Even so, it still may look somewhat jerky.

If your build is stationary, another way would be have the prim the avatar sits on be unlinked and invisible and rotate that whole thing once the avatar sits on it. You could adapt some of the smooth rotating door script examples in this case.

Alternatively, yet another approach would be to create a custom non-looping animation that rotates to the desired orientation at the desired speed and have that animation be applied when the avatar sits down. That would be the most lightweight and smoothest solution, but it requires the creation of a custom animation asset outside of SL. And it could limit the flexibility of the project depending on how it is intended to be used.

Edited by Fenix Eldritch
Link to comment
Share on other sites

Regarding llSitTarget, that's only applied when an avatar sits down on the object. Any changes made using llSitTarget won't be applied until the avatar stands and then sits down again.

The llSitTarget wiki page includes Strife Onizuka's UpdateSitTarget function, which changes the sit target and moves the avatar using llSetLinkPrimitiveParamsFast to reflect the changed sit target.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1561 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...