Jump to content

Floating script that doesn't move the avatar when attached


Mistress69Nikita
 Share

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

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

Recommended Posts

I'm looking for a code segment or command that gradually adds then subtracts an amount in one cardinal direction. It would do this while attached to an Avatar without altering the position of the avatar in the process. In theory, object position would be a straight upwards path A to B at speed W relative to avatar origin x,y, z.

I'm not familiar with how avatar position relates to avatar object position, so when I put my object on its just moving everything and that is unwanted.

Does SL even recognize separate positional data for an object attached to a part of the body and where that object is oriented relative to that attachment point? I ask that because the code I have in it is changing the object's position data (gposition commands) and when attached to my avatar, causing it to float. Why is the object position altering the avatar position when attached to the avatar?

Link to comment
Share on other sites

Are you using llMoveToTarget? That function only works in physics-enabled objects and as an attachment the avatsr is the "physics-enabled object."

If you want to only move the attachment itself, yoj must use some other function like llSetPos, which unfortunately isn't smooth like llMoveToTarget, so you will need to use smaller increments while moving from A to B.

For more specific info, seeing the object would probably get you more specific advice, or showing the script (the part that moves) would show us what the problem is exactly. 

Edited by Wulfie Reanimator
Link to comment
Share on other sites

Are you making something like a "pet" you can wear that moves independently of you (or appears to)? If so, a lot of stuff involving the position of the object could affect your avatar position. I've gotten better results by attaching such a thing to the avatar center, and sort of "faking" the apparent animation (by switching textures/alphas, rotating the attachment, etc.).

Edited by Berksey
Link to comment
Share on other sites

  • 1 month later...

So basically a loop of IISetPos with multiple variables.

Variable for the the new position, the current position, the old position, 2nd last position, the current speed, current upward acceleration, and current downward acceleration. Might get away with less but I'd probably find trouble with reading and rewriting a variable in the same logic argument.

Its an annoying amount of code and will look choppy as a result while processing. But thanks for making me aware of the possibilities.

Link to comment
Share on other sites

The other option would be to get into bento animations. You could animate one of the bones to move up and down at the desired position. If it needs to move with a non-bento body part, that would need to be included in the animation. For example, to make a ball bounce in the hand. use a wing bone to move the object up and down from the hand, you would need to also animate the hand with it, or at least freeze it in place so the hand will stay in sync with the position of the ball being animated

Link to comment
Share on other sites

On 18/04/2018 at 6:19 AM, Mistress69Nikita said:

Does SL even recognize separate positional data for an object attached to a part of the body and where that object is oriented relative to that attachment point? I ask that because the code I have in it is changing the object's position data (gposition commands) and when attached to my avatar, causing it to float. Why is the object position altering the avatar position when attached to the avatar?

For "Does SL even recognize separate positional data for an object attached to a part of the body"

The answer is simple : No 

These positions depends of the five  things : 

a) the positional data of "the center" of an avatar

b) the poistional data of one object if the avatar is sat on this object

c) the positional data of joints of the avatar

d) the postionnal data of the animation of the avatar 

e) the weight paints of rigged mesh change the posituionnal datas

 

For "where that object is oriented relative to that attachment point" . Yes you can set and get 

But it s relative to the attachement point . who is not the center of avatar point

The center of avatar point is static even when your avtar plays an animation . The animation moves relatively to the center of the avatar point . And of course the displayed avatar can be far from the "center of avatar"

 

 

Edited by Miranda Umino
Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...