Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animating attached object headache

Cerulia Moxie
Registered User
Join date: 22 Dec 2005
Posts: 43
01-10-2006 16:13
Hello all, I hope you can help... I've been tearing my hair out trying to get this animated attachment to work. I've finally gotten it to the point where it works just fine when it's unattached, and it animates when I attach it, but all the prims are rotated 90 degrees! They move ok, but the rotations are all wrong...

I'm using llSetPrimitiveParams to change the position and rotation at the same time, sending a linkmessage from the root prim to all the child prims to tell them which animation frame they're in. As I said, it works fine on the ground so I think it must be something simple that changes when you attach an object that I'm not taking into account.

Oh, and also, I recorded the target rotations while it was attached, and it's just not going to them... The code tells it to go to one rotation, but it actually goes to something completely different.

If you can help at all I'd really, really appreciate it, because it's giving me an awful headache ^_~

Incidentally, while I'm asking, does anyone know a way to smooth movement? The object tends to break up a bit as it moves to different frames, I could just add more positions for it to move through but with the 0.21 second delay on llSetPrimitiveParams that would just make it jerky instead...
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
01-10-2006 16:22
well howabout offseting the rotations by the effected 90 degrees (im probally not fuly understanding the situation)
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
01-10-2006 16:32
The code tells them to go to a rotation that's offset from the root prim. On the ground, the root prim is probably at ZERO_ROTATION. Depending on the attachment point, the attached object ends up rotated. Try rezzing just a cube, and attaching it to different points on your avatar, and then see where the local axes point. So your code is probably working, but it's still relative to the root prim, which is now pointed in a different direction.

The solution could be to change the rotations you send to the child prims to compensate. Or re-build your object so the root prim ends up the right way when attached (which means it'll be broken when it's on the ground). Or... there might be other ways to deal with this.
Cerulia Moxie
Registered User
Join date: 22 Dec 2005
Posts: 43
01-11-2006 01:00
Well, the thing is that I got all the rotations while it was attached, so they *should* be right - the rotation of the root hasn't changed. I made a script that says out loud the position and rotation of the prim, and then used those in the script, but if you use that to find the position after the script's moved them, the rotations don't match. I guess I should see if they're all wrong by the same amount and try adding that or something...
ragarth Doolittle
Registered User
Join date: 18 Nov 2005
Posts: 28
01-17-2006 01:35
I had a similer problem, I changed from using llGetRot to llGetLocalRot and this resolved my problems.