Penguin Action Toolkit
  • 🐧Welcome
  • Guide
    • Step-by-Step Guide
      • Step 1: Install PAT
      • Step 2: Tutorial Scene
      • Step 3: Character - Action States
      • Practice 0: Add an Input Tag
      • Step 4: Character - Tags
      • Practice 1: Combo
      • Step 5: State Modifiers
      • Practice 1.1 & Ex: Grant Tag Mod
      • Step 6: Animation Montage
      • Step 7: Trigger Animation Event
      • Practice 1.2: Back to Grant Tag Mod
      • Step 8: Animator
      • Step 9: Attributes
      • Practice 2: Cost HP
      • Step 10: Effects
        • Step 10.1: Hitbox & Hurtbox
  • Definition & Inspector Detail
    • Actions
      • Action State
      • State Modifier
      • Move Set
    • Tag
    • Attribute
    • Effect
    • Player
    • Input
    • Locomotion
  • Tutorial
    • Installation
    • Contents of the Assets
    • Character
      • Create a Character
    • Set Up Player
    • Create a new Tag
    • Create a new Modifier
    • Use Attributes
    • Effect
      • Create an Effect
      • Apply Effects
    • Animation
      • Animatior Controller
    • PAT Manager
  • Beneath the Feathers
    • The Other One
    • Help on the Way
    • Victim or the Crime
    • Unbroken Chain
  • PAT Game Jam
    • Save the Penguin
    • Schedule
    • Terms & Conditions
  • FAQ
    • Change to Your Own Model
Powered by GitBook
On this page
  • Definition
  • Inspector Details
  • Mod Name
  • Timing Attribute
  • Events
  • Some Common Modifiers
  • Grant Tag Mod
  • Animation Montage Mod
  • Reference Animation Controller
  • Layer
  • Animation State
  • Fade in Time
  • Fade out Time
  • Animation Clip
  • Keep Play on Exit
  • Exit On Montage End
Edit on GitHub
  1. Definition & Inspector Detail
  2. Actions

State Modifier

PreviousAction StateNextMove Set

Last updated 6 months ago

Definition

State Modifiers are attached to Action States. They are triggered during the state and grants different functionality to Action States. For example, controlling animations, activating hitboxes, modifying movement speed, etc. Action States by themselves only form a logic chain of your character, they need State Modifiers for different functions.

Most modifier scripts are named as XXXMod, where Mod stands for MODifier. Each Modifier has a Begin and an End Timing Attribute, which defines when will this mod get activated, as well as the duration of it.


Inspector Details

State Modifier inspector

Mod Name

A name for you to track what this modifier is for.

Timing Attribute

Controls when this modifier will be activated.

There are basically two different Modes can select:

By Time in State

An Action State will count the time after it is entered.

Modifiers in this mode will be triggered on Begin Time and stop functioning after End Time.

  • Begin Time of -1 means the modifier will be triggered as soon as the State is entered.

  • End Time of -1 means the modifier will not be turned off until the State is exited.

By Animation Event

You may add Trigger Animation Events to any animation clip through Unity. You must input an index to it in the inspector.

Modifiers in this mode will be triggered when the animation attached to the current state has passed Begin Index and will end on End Index.

Please align indexes in increasing order for proper functioning. Note that Action States must have an animation for modifiers using this mode.

  • Begin Index of -1 means the modifier will be triggered as soon as the State is entered.

  • End Index of -1 means the modifier will not be turned off until the State is exited.

Events

Apart from the functionality of modifiers themselves, you can add additional functionality by using the begin & end unity event exposed in the inspector. And a vanilla state modifier is solely for that. But be aware that Unity events are not easy to maintain and debug, please don’t use that for your core logic.

Some Common Modifiers

Grant Tag Mod

When the character is in an Action State, it will hold all tags listed in the State’s Main Tag. Using this mod, it allows an Action State to have extra Tags for further State transition.

Animation Montage Mod

This Mod plays an animation state in the model's animator and uses crossfade to create transitions.

Please note that this ONLY works with animator that structures in PAT’s template. If you need your own way to implement the animator, you might want to have your own version of Animation Modifier.

Reference Animation Controller

Drag in the Animation Controller that contains the animations.

Layer

Choose the layer that contains your desired Animation.

Animation State

Name of the State that contains the desired Animation state inside the Animator.

Fade in Time

The duration of crossfade when the animation starts.

Fade out Time

Fade out duration, and the target is a state called “Empty” in the same layer. This is helpful because the new state might be playing animation in a different layer.

Animation Clip

Clicking on it brings you to the location of selected clip

Keep Play on Exit

The animator will not try to fade to “Empty” automatically when state end.

Exit On Montage End

Action State will auto exit if the Unity Animation Play Time reaches 1, helpful for many actions like attack, roll.

Grant Tag Mod inspector