Is there a small thing I'm missing?
Trying to make a broomstick
These forums are CLOSED. Please visit the new forums HERE
Making Vehicles, how do you edit sitting? |
|
|
Indigo Myriam
Registered User
Join date: 1 Apr 2006
Posts: 9
|
04-19-2006 16:49
Is there a small thing I'm missing?
Trying to make a broomstick |
|
Cottonteil Muromachi
Abominable
Join date: 2 Mar 2005
Posts: 1,071
|
04-19-2006 17:46
People usually put a sit target script in an invisible prim in the link set to make it easier to adjust sitting positions.
|
|
Frash Tandino
Registered User
Join date: 11 Apr 2006
Posts: 1
|
use llSitTarget
04-22-2006 12:37
there is a function called llSitTarget() that will position and rotate the avatar as you need.
it will take a bit of tweaking to get it right. you need to supply llSitTarget() with two pieces of data: - the position you want the avatar to sit, relative to the middle of the object - the rotation of the avatar, also relative to the orientation of the object remember that when positioning, EVERYTHING IS RELATIVE TO THE ROOT PRIM. i recently spent a looooot of time wrapping my head around this and getting my av to sit the right way on something i built. here's a little snippet that may help you out...it will rotate your av 90 degrees around your Z-axis (the up-down axis) and it will set your av back 0.3 meters along the X-axis. you can stick this in the "state_entry()" section of your object's script so that the sit position is automatically set when the object appears. don't worry too much about the math stuff in the script (llEuler2Rot and DEG_TO_RAD). fiddle with the values in the <0,0,90> part of the script to tweak the rotation. // -------------------------------- rotation avRotation = llEuler2Rot(<0,0,90> * DEG_TO_RAD); vector avPosition = <-0.3,0,0>; llSitTarget(avPosition, avRotation); // ----------------------------------- One thing to remember is that since everything is relative to the root prim, you may need to actually rotate the root prim so that its axes are in line with the rest of the world. for instance, if your object is flipped upside down, your avatar will sit on it upside down and you'll need to compensate for that in your script. The best way to build, I have found, is to try and orient your objects so that their various axes are aligned with the "natural" axes in the world. Relative, relative, relative...I can't stress that enough. Find out more about llSitTarget here: http://secondlife.com/badgeo/wakka.php?wakka=llSitTarget |
|
akaBigWurm Senior
Registered User
Join date: 14 Apr 2006
Posts: 3
|
04-26-2006 10:53
Thats werid I am working on a broomstick too, getting the back part right is a pain. But I think I got a good idea.
|