Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Camera

Grizzly Ogg
Registered User
Join date: 10 May 2006
Posts: 39
02-10-2007 03:20
Hello , i need a secruity camera script. Its like this: IF someone can make this : When a person walk infornt of it the camera will rotate after but the camera shall still be in the same posion so it shall not move away even if it rotate after the person.
Or make a simple rote script , plz help me!
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
02-11-2007 02:36
Here's a modified script from the Examples page of the Wiki that seems to do what you want when I placed it into a security camera mockup I made. Please note that it scans a full 360 radius around the object, if you want more limited movement you'll need to adjust that.

CODE

// Look At
// by Jim Bunderfeld
// This script is open source. Please make changes as necessary.
// For best results, put this script in a cone.
////////////////////////////////////////////////////////////////

default
{
state_entry()
{
// Runs a sensor for an agent within 10 meters. It repeats every second.
llSensorRepeat("","",AGENT, 10.0, PI, 1.0); }

sensor(integer det)
{
vector pos = llDetectedPos(0); // Gets the pos of the nearest avatar.
llLookAt(pos, 0.1, 0.5); // Point the object to pos.
}
}
Grizzly Ogg
Registered User
Join date: 10 May 2006
Posts: 39
02-13-2007 05:01
DUDE! , thanks so much man , im very happy now ;) ill give you 100L ;)
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
02-14-2007 03:43
That wasn't necessary but it is appreciated. Thanks. :) I'm glad it worked for you.