Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation scripting snag (Yes, I did a search first)

Barry Moody
Registered User
Join date: 17 Dec 2006
Posts: 24
01-20-2007 23:05
I looked around and couldn't find a match to my problem. I say this because I saw a LOT of posts on rotations...

I'm trying to set up a chair which will make the user sit in the right place at the right rotation. I got it to work based on the chair being in one location facing a particular way, but the chairs will be repeated in different positions and rotations. When I applied the script to other chairs, my avatar would sit off-centered, facing the wrong way.

I saw a few posts that show how to offset rotation and it seemed to work until I actually rotated the chair. With all this information, let's see if I can now ask the right question...

Is there a way to set the rotation and the position of the avatar based on the rotation and position of the seat so that it will always "face front" in the direction of the chair, and be be offset to look as if it's actually "sitting on" the chair?

I'm still getting the hang of scripting with LSL, but this is the first time I've had to script in three dimensions, let alone a fourth!
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
01-21-2007 04:26
Generaly the SitTarget is in the local cordinates.

This means that once you have them siting in the proper place you can disable the script.

The only problem comes in when you copy the item since copys don't keep the SitTarget.

You could llOwnerSay the SitTarget vector and then hard code it into the script.
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
01-21-2007 07:53
You might try this nifty tool by Lex Neva. It's a pair of scripts that help you discover the proper rotations for the SitTarget

/54/6a/153963/1.html