Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llLookAt movement limit?

Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
07-09-2009 22:35
I'm using a script to make a prim turn and look at the nearest avatar. Works great. My question is, is there any way to keep it from looking up/down, and force it to only turn left/right?

Here's the script I'm using.

CODE


default
{
state_entry()
{
llSensorRepeat("", "", AGENT, 10.0, PI, 0.2);
}

sensor(integer total_number)
{
llLookAt( llDetectedPos(0) + < 0.0, 0.0, 1.0>, 3.0, 1.0 );
}
}

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-10-2009 00:09
vector them = llDetectedPos( 0 );
vector me = llGetPos();
llLookAt( < them.x, them.y, me.z >, 3.0, 1.0 );
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
07-10-2009 00:25
I think I got that part of it working. Thanks.