๐ŸงŠZones

(Needs Update)

Overview

Zones are Triggers that Enable Logics on the Animal, like Jump, Actions, Deaths... etc. Once an animal Enters a Zone it can be activated via Input or Automatically.

Requirements

  • A zone requires any type of collider set as Trigger.

  • The Layer set on the GameObject must be different from the Layers set on the Ground Layer in the Animal Controller. Usually is set as Ignore Layer

The Animal needs to have any type of collider and a rigid body to interact with the zone

Properties

Automatic

As soon as the animal enters the zone it will activate the zone logic. If set to false you need to manually call: Zone.Activate()

Disable After Used

Disables the zone after it's used 1 time.

Limit

How many characters can use this zone at the same time. If set to a negative value (-1) then it has no limit.

Trigger

As above, which collider is the trigger for the zone to activate

Layer

Which layer should be used to detect the animal

Zone Type

A zone can modify a Mode, Force, State, or Stance on an animal, depending the Action set in the Zone.

Type: Mode

Mode ID

Which Mode ID should activate

Ability Index

Which ability should activate. See the Modes documentation for more information

When the Mode is Set to Action, the Ability Index Parameter it will automatically change to Action ID to help you better which Action Index to play on the Animal

Status

How should the Mode be played?

Mode Power

Value assigned to the mode float value when using the zone

Force Mode

Plays a mode no matter if a mode is already playing

Type: State

When the Zone is set to State, The animal will automatically make an State Action if it enters the Zone Trigger.

State ID

ID of the State to modify e.g. Fly, Death etc.

On Enter/Exit

The zone can have different enter and exit actions:

Activate

Activate a State on an Animal.

Horse dies (Activates Death) when it touches the Death Zone Trigger

Allow Exit

Some States cannot exit on their on because some conditions may need to be completed. Calling the Method: State.AllowExit() on the Animal permits the state to exit and other states with lower priority to try to activate themselves.

For Example: A character is Flying; then enters A Fly State Zone with Allow Exit set, this will allow other States like Fall to be activated since the Fly State is allowing lower priority states to be active.

Force Activate

Some States cannot be activated on their on, because it may require some conditions to be completed. This action forces any state to be Active.

E.g.: The Swim State can only be Activated if the animal touches the water. but it can be forced using this action.

Disable

Disable a State on an Animal.

E.g.: you can have a Jump State Zone to Disable the Jump State when a character enters a room.

Enable

If a State on an animal is Disabled, it will enable it back.

E.g.: you can have a Jump State Zone to Enable the Jump State when a character exits a room.

Set Exit Status

Sets the Exit status on the Animator to be true

Type: Stance

When the Zone is set to Stance, The animal will automatically make an Stance Action if it enters the Zone Trigger.

Stance ID

ID of the Stance to modify.

On Enter/On Exit

The zone can have different enter and exit actions.

Activate

On Entering the Trigger Zone: the Current Stance on the Animal will be equal to the Zone Stance ID.

Exit

On Exiting the Trigger Zone: the Current Stance on the Animal will be equal to the Zone Stance ID.

Set Default

Set's the default stance to the stance specified in the StanceID

Type: Force

Force

Amount of Force that gets applied to the animal

Enter Acceleration

Acceleration to apply the force when the animal enters the zone

Exit Drag

Set a value for the drag applied when the animal exits the zone

Limit Force

Set a limit for the total amount of force to apply

Air Control

Can the animal be controlled whilst in the air?

Grounded

Changes if the animal is grounded when entering the force zone

Other Parameters

Weight

Probability to activate the zone when entering the zone 0 - 1. 0 = 0%. 0.5 = 50%, 1 = 100%.

Angle

Limit the activation of the zone from certain angles only

Reset on Active

Removes the stored Animal on the zone when the zone is activated, resetting it to it's default state

Tags

Set this parameter only if you want the zone to activate with certain gameobjects with tags.

Bone Only

Activate when a bone enters the zone. The bone needs it's own collider.

Bone Name

Name of the bone to check if Bone Only is true.

Events

On Animal Enter Zone

Invoked when the Animal Enters the Zone Trigger

On Animal Exit Zone

Invoked when the Animal Exits the Zone Trigger

On Zone Active

Invoked when the Animal Activates the Zone

On Zone Failed

Invoked when the zone fails to activate for whatever reason e.g. the wrong animal walks into it

Last updated