Difference between revisions of "PathEnemyFSM"

From Headbone Creative
Jump to: navigation, search
(Initial page, includes API information and categories)
 
(Updating API info)
Line 2: Line 2:
  
 
== Public Variables ==
 
== Public Variables ==
/// <summary>
+
=== player : GameObject ===
/// The player.
+
This is the player object that the enemy will chase if it gets close enough.  
/// </summary>
+
=== playerTag : string ===
public GameObject player;
+
If the player object is not set when the scene starts, this script will attempt to find an object with this tag. If no object is found, an error is printed to the debug console.  
+
=== path: Transform&91;&93; ===
/// <summary>
+
This is the set of nodes that make up the path that will be followed. The enemy moves to the first node in this list before continuing along the path in the direction specified by the other variables below.
/// The player tag.
+
/// </summary>
+
public string playerTag = "Player";
+
+
 
/// <summary>
 
/// <summary>
 
/// The path.
 
/// The path.
 
/// </summary>
 
/// </summary>
public Transform[] path;
+
public ;
 
 
 
/// <summary>
 
/// <summary>

Revision as of 18:38, 16 April 2013

This script implements an AI that will follow a set path, unless the player comes to close. Once the player is close enough it will follow the player until the player is out of range, or until the maximum distance away from the path is reached (if useLeash is set to true).

Contents

Public Variables

player : GameObject

This is the player object that the enemy will chase if it gets close enough.

playerTag : string

If the player object is not set when the scene starts, this script will attempt to find an object with this tag. If no object is found, an error is printed to the debug console.

path: Transform&91;&93;

This is the set of nodes that make up the path that will be followed. The enemy moves to the first node in this list before continuing along the path in the direction specified by the other variables below. /// <summary> /// The path. /// </summary> public ;

/// <summary> /// The chase start distance. /// </summary> public float chaseStartDistance = 1.0f;

/// <summary> /// The chase stop distance. /// </summary> public float chaseStopDistance = 2.0f;

/// <summary> /// The chase speed. /// </summary> public float chaseSpeed = 0.5f;

/// <summary> /// The rotate to path flag /// </summary> public bool rotateToPath = true;

/// <summary> /// The rotate speed. /// </summary> public float rotateSpeed = 5.0f;

/// <summary> /// The chase mode. (how to chase it) /// </summary> public PathEnemyChaseMode chaseMode = PathEnemyChaseMode.lerp;

/// <summary> /// The waypoint radius. /// </summary> public float waypointRadius = 0.1f;

/// <summary> /// The leash distance. /// </summary> public float leashDistance = 20.0f;

/// <summary> /// The use leash. /// </summary> public bool useLeash = true;

/// <summary> /// This flag indicates whether or not the scene is 2d or 3d. /// This affects how the rotation is calculated. /// </summary> public bool is2dScene = true;

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox