Difference between revisions of "ProximityTracker"

From Headbone Creative
Jump to: navigation, search
(Initial page, includes API information and categories)
 

Latest revision as of 05:46, 20 April 2013

This script tracks objects that are near the object to which the script is attached. The script is configured to track in a 2d scene by default. It uses SphereCast to determine what objects are near.

Contents

[edit] Public Variables

[edit] radius : float

This determines how big the sphere that is cast is, and therefore how close things must be to be within the cast distance.

[edit] updateInterval : float

How often to update the tracking list, in seconds.

[edit] sphereCastDirection : Vector3

This is the direction that the sphere cast will be sent.

[edit] sphereCastRelativeStartingPosition : Vector3

This is the relative position of where the sphere cast that checks for objects around the current object will start.

[edit] sphereCastDistance : float

How far to send the sphere cast when tracking.

[edit] layersToTrack : LayerMask

This allows only objects on certain layers to be tracked.

[edit] Public Functions

[edit] GameObject GetClosest ()

Returns the object that is closest to the object to which the script is attached. This returns null if no objects are within range.

[edit] List<GameObject> GetAll ()

Returns the list of all objects that are within tracking range of the object to which the script is attached.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox