|
Own Westland
Second.Life@msn.com
Join date: 24 Dec 2007
Posts: 49
|
01-28-2008 02:11
Below is the script of my sitting target. But every time when I use it, I even can't know where I'm sitting because I'm teleported to another place and can't see my avatar and can't move. What's the root cause? There must be some serious problem in my script.
default { state_entry() { vector my_pos = llGetPos(); rotation my_rot = llGetRot(); vector avatar_pos = <0,0,1> - <0,0,0.186>;
vector target_pos = my_pos - avatar_pos - <0,0,0.186> + <0,0,0.4>; rotation target_rot = <0,0,0,1.0>*my_rot;
llSitTarget(target_pos, target_rot); } }
_____________________
Helpful MSN Group: Second.Life@msn.com
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
01-28-2008 02:38
sit target uses local coordinates based on the prims center. you try to apply global positioning to your sit target which results in the target position being dependant on the objects position in the sim. same goes for rotation. Since sittarget uses LOCAL coordinates, this will rotate you based on the objects rotation. llSitTarget(<0,0,0.5>,llEuler2Rot(DEG_TO_RAD*<0,0,90>  ); Something like that should do the trick.
|