Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A Basic llSitTarget Tutorial.

Ryan Linden
Linden Lab Employee
Join date: 31 Dec 1969
Posts: 87
12-02-2003 09:34
A Basic llSitTarget Tutorial.

CODE
llSitTarget(vector offset, rotation rot)


llSitTarget allows you to define the position and rotation of an avatar sitting on a scripted object.

When an object has a sit target, the first avatar that tries to sit on it will sit in a position and rotation relative to the center of the scripted primitive. A offset of <0,0,0> will disable the sit target, returning the object to the default sitting behavior. A rot of <0,0,0,1> (or ZERO_ROTATION) will make you sit facing the local X axis, head toward the local Z axis.

Each primitive may have one sit target. This means sit targets may be applied to children as well as parents (making it possible to make multi-passenger vehicles). A sit target on a child prim needs to be set up relative to that child prim.

If a object has multiple prims, and several have sit targets, the avatar will sit on the a chosen prims target, or if that fails, the next open sit target prim, or if that fails revert to default sit behavior. This means that if you right click on the object, depending on where you right click, where you sit will be determined. If you chose "Sit" on a primitive without a target assigned, you will sit on the lowest linknumberd primitive in the set that has a sit target (often the parent) unless that prim is already occupied, in which case, you will sit on the next, and so on. If you choose to sit on a prim with a target, you will sit on that prim no matter what the link order is unless it is occupied, in which case, start running through the same cycle. If all of the seats are occupied, you try to sit in the default way defined by face and orientation from the seater.

You can use llAvatarOnSitTarget() to return the key of the seated avatar, and change the camera of the seated av by using llSetCameraAtOffset and llSetCameraEyeOffset.
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
Great info
12-04-2003 08:52
Thanks Ryan. The behavior of the child object sittarget functionality was confusing to me at best. This clears it all up!

-Apotheus Silverman
Wahbi Argonaut
Junior Member
Join date: 23 Sep 2003
Posts: 7
Question
01-24-2004 18:41
I'm trying to add motion to a boat I aquired. If I make my llSitTarget called like
llSitTarget(<1, 0, 0>, <0,0,0,1>;);

I end up facing to the "west" of the boat not to the front.

Why would that be?
Nephilim Rampal
Junior Member
Join date: 14 Jan 2004
Posts: 3
01-27-2004 05:45
I'm trying to make a surf board.... How do I make the sit animation be a standing or crouching one instead?
_____________________

Yours Truely,

Nephilim Rampal