Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llRotLookAt, disabling a specific axis.

Gryphe Padar
Registered User
Join date: 4 Jul 2005
Posts: 14
07-15-2007 07:49
Afternoon, folks. I was wondering if it was possible to disable a specific axis when using the llRotLookAt function.

The code underneath is part of a head (child prim) that turns towards the nearest avatar. It's all working fine, but the head is tilted sidewards, which looks very odd.

<<START CODE>>

vector Offset = (vector)target - llGetPos();
llRotLookAt(llRotBetween(<0,1,0>,Offset), 1.0, 1.0);

<<END CODE>>
Gryphe Padar
Registered User
Join date: 4 Jul 2005
Posts: 14
07-15-2007 23:40
I fixed my own problem, by adding three lines above the forementioned two.

vector target = llDetectedPos(0);
vector target2 = llGetPos();
target.z = target2.z;