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
  • Goal
  • Review
  • State Modifier
  • Component
  • Events
Edit on GitHub
  1. Guide
  2. Step-by-Step Guide

Step 5: State Modifiers

PreviousPractice 1: ComboNextPractice 1.1 & Ex: Grant Tag Mod

Last updated 6 months ago

Goal

  • Understand State Modifiers


Review

We have talked about Action States and Tags and chained States together, but the game feels wrong. We want a more precise control over the States, so there comes State Modifiers.


State Modifier

State Modifiers works with Action States to modify the action behaviors. They are triggered during the State they are attached to and grants different functionality to the State. 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.


Component

View of a basic State Modifier
  • Mod Name A name for you to track what this modifier is for.

Animation Event requires modifying the animations, so let's use By Time in State for now.

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.

This is only a basic template of a State Modifier. It only triggers Unity Events. Given that Unity Events can be hard to handle, we allow you to extend from State Modifier and create your own modifiers. We also provided template Mods that you can use and learn the implementation pattern.

Timing Attribute Controls when this modifier will be activated. There are two different Modes to select. You can find more details in .

Timing Attribute