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
  • Find SwordMoveset
  • Input Unit
  • Tag Container
  • Input Tag
Edit on GitHub
  1. Guide
  2. Step-by-Step Guide

Step 3: Character - Action States

PreviousStep 2: Tutorial SceneNextPractice 0: Add an Input Tag

Last updated 6 months ago

Goal

  • Undertand what Action State is

  • Find Tag Container

  • Understand how Action State are connected to Input Tags


Find SwordMoveset

Under MyFirstCharacter, you can find SwordMoveset Object.

Click onto Attack1.

What matters in this step is the Action State Script.

An Action State is the minimal state that describes a character’s action.

Action States include locomotion actions like moving, jumping, dashing, or combat actions like swinging a sword or firing a gun. It is the basic unit that adds up to the entirety of our action system in PAT. Action State by itself has very limited functionality, it serves as a that shows which state a character is in (what it is doing), and what it can do from the current state.

For more details, you can find in Action State.

Most real functionalities are fulfilled by State Modifiers that are add on to Action States, and we will cover those later.

So how does an Action State know when it should be triggered? What allows the penguin to attack after a left click?


Input Unit

If you recall what we mentioned at the end of Step 2: Tutorial Scene, the Player Component handles your inputs. Each input unit bounds an action reference from the Input Action System to an Input Tag.

For example, if you input the Attack button (left clicking your mouse / west button on controller), the Player will send a Light Attack Tag to the Character, and Character will find if it matches the Action State's Input Tag.


Tag Container

For you to check what tags were sent to a character, we have a component called Tag Container generated by Character component. In this tutorial, it is on MyFirstCharacter.

Note that it is only added to the object at runtime, so you have to start the game first to find it in the inspector.

Tag Container is a very useful tool for debugging your character, especially when the character doesn't behave as you expected. You can check whether the player input is correctly handled, or which State Tags are added to the character at this moment.


Input Tag

On each Update, all Action States compare their Input Tags with current tags in Tag Container. If they found the matching Input Tag, the Action State will try to be triggered. This is how the penguin attacks -- It receives an Input Tag from the Player.

However, this doesn't mean they can always be triggered with the Input Tag. There are more restrictions that will be explained in the next Step.

Now let's try do the same thing for another Action State.

Player Component from last step
How the Tag Container looks like if you left click your mouse
Input Tag - Light Attack