Jump to content

Moving an avi with a moving child!


conrad Evanier
 Share

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

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

Recommended Posts

Hi all im moving a child prim with  llSetLinkPrimitiveParams(LINK_THIS,[PRIM_POSITION,llGetLocalPos() + <0,0,1>]); and then back again, how do i get my avi to move with the prim while seated as at the mo he just stays at the first position. I know how to get the key of seated avi but stuck on moving him lol.

Link to comment
Share on other sites

That example works, but the specific part about updating the llSitTarget is kind of optional here, if I understand the OP. Assuming the objective is to simply move the avatar around with the other child prim, simply applying llSetLinkPrimitiveParamsFast() to the link corresponding to the avatar should be all that's needed.  Indeed, all this works fine with no sit targets anywhere in the linkset (which can help if there are to be more people sitting than there are separate prims in the linkset).

Link to comment
Share on other sites

Exactly, Your avatar is the last link in the linkset, so you can move it around the same way you move any other child prim...

llSetLinkPrimitiveParamsFast( llGetNumberOfPrims(), [ PRIM_POS_LOCAL, Old_prim_pos_local + offset *llGetRot() ]);

Link to comment
Share on other sites

I'm not sure if it amounts to the same thing or not (I don't think it does, actually), and I suppose it partly depends on exactly how you want to move the avatar, but I think the way I'd do it is something like

integer n = llGetNumberOfPrims();		vector offset = <1.0,0.0,0.0>;		list l = llGetLinkPrimitiveParams(n,[PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);		vector pos = llList2Vector(l,0);		rotation rot = llList2Rot(l,1);		llSetLinkPrimitiveParamsFast(n,[PRIM_POS_LOCAL,pos+offset*rot]);

 Isn't llGetRot() going to move you relative to the object's rotation rather than yours?  

Link to comment
Share on other sites

Thanks Innula that works great, but think il stick with the sit target update as i have lots of child prims that will all be seats moving up and down so that fits the bill.  Both work a treat a slight delay when the child moves and the avi but not to bad.  Thank you all for your ideas :)

Link to comment
Share on other sites

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