Don't click here unless you want to be banned.

LSL Wiki : llTarget

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are xcrawl107.alexa.com
integer llTarget(vector position, float range)

Defines a target within range of position.

While the object with the task is outside range of position, not_at_target events will be raised.

Upon coming inside range of position, an at_target event will be raised, and will keep being raised until this target's handle (the return value returned by llTarget) is removed by llTargetRemove or the object moves outside of range of position.

Returns an integer ID (handle) for the target. This handle can be used to remove a target using llTargetRemove.

This function persists across states.


Functions | at_target | not_at_target | llTargetRemove
Comments [Hide comments/form]
Is position in region or world co-ordinates?
-- RichardPinkerton (2005-07-10 08:46:41)
Region. Almost every function uses region, and not world coordinates.
-- KeknehvPsaltery (2005-07-11 16:25:49)
Is there a way to use llTarget to define a bounding wall. So for instance, if object's x position exceeds 49.5, turn it into a fish. Or is there another ll function I could do this with to keep my code clean?
-- BafiliusGoff (2006-06-13 13:08:43)
Sort of, if you wanted to bound things w/in a sphere, you could target the center of it and a given radius. When you hit the edge, you start getting not_at_target events, which you can use to do correction.

The main issue is that you're limited to perfect spheres of a given radius. If you want a more robust solution, you're on your own.

Alternately, you might be able to use multiple llTarget() calls to define an area of intersection, which you can detect when all of your targets are generating at_target events. I'm not sure if you can have multiple targets at once, but the handle return from llTarget() certainly implies you can.
-- IridescentEnzyme (2006-06-18 13:29:35)
Attach a comment to this page: