Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Point at a Avatar

Ynot Fenua
Registered User
Join date: 11 Oct 2006
Posts: 18
07-03-2007 13:03
I know who to rotate an object to "face" a given point - but what is the best way of getting it point at an avatar.

How can i easily work out an avatar's position ?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-03-2007 18:12
From: Ynot Fenua
How can i easily work out an avatar's position ?
If the target avatar is an agent returned by a sensor, or if it helpfully touched the scripted object, then llDetectedPos() would work. (But I'm not entirely sure this is the question.)
Ynot Fenua
Registered User
Join date: 11 Oct 2006
Posts: 18
Thanks
07-04-2007 09:37
Yes - of course it is - so i think I can do this...


One I know the name of the Avatar to point at .....

1) Do a sensor sweep - full radius full angles to detect the agent

2) get its position

3) do a llRotLookat

repeat 1 to 3 maybe every 0.5 seconds to get a smoothish tracking


Thanks
Ynot Fenua
Registered User
Join date: 11 Oct 2006
Posts: 18
Done it - thanks
07-04-2007 10:33
I now have a tracking spotlight - which you can command to track a given avatar, and it works.. :-)

Great for stages etc.