Class GetBehindState
Combat sub-state that circles the NPC around to the back of its current target.
[CreateAssetMenu(fileName = "New AI GetBehind State", menuName = "FishMMO/Character/NPC/AI/GetBehind State", order = 0)]
public class GetBehindState : BaseAIState, ICachedObject
- Inheritance
-
ObjectScriptableObjectGetBehindState
- Implements
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Enable KeepsCombatTarget on assets of this type. Without it the attacking state clears the combat target on the way out and this state finds nothing to move behind, which turned every flanking roll into a disengage.
Fields
BehindDistance
Distance behind the target to move.
public float BehindDistance
Field Value
MaxManoeuvreSeconds
Seconds to spend getting behind the target before giving up and attacking from here.
[Tooltip("Seconds spent manoeuvring before rejoining the attack. 0 = no limit.")]
public float MaxManoeuvreSeconds
Field Value
RotationSpeed
Speed at which the AI rotates to face the target.
public float RotationSpeed
Field Value
Methods
Enter(AIController)
Called when entering the GetBehind state. Calculates and sets destination behind the target.
public override void Enter(AIController controller)
Parameters
controllerAIControllerThe AI controller.
Exit(AIController)
Called when exiting the GetBehind state. Can be used to stop movement or reset parameters.
public override void Exit(AIController controller)
Parameters
controllerAIControllerThe AI controller.
UpdateState(AIController, float)
Called every frame to update the GetBehind state. Handles rotation and destination checks.
public override void UpdateState(AIController controller, float deltaTime)
Parameters
controllerAIControllerThe AI controller.
deltaTimefloatFrame time.