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
  • Find Attack2
  • Add Requirement Tag to Attack2
  • Add Main Tag to Attack1
Edit on GitHub
  1. Guide
  2. Step-by-Step Guide

Practice 1: Combo

PreviousStep 4: Character - TagsNextStep 5: State Modifiers

Last updated 6 months ago

Goal

  • Make a combo with Attack1 and Attack2

  • Understand how to use Tags to change Action States


Review

We've covered the very basic terminologies and structure of PAT, and now it's time to check if you can use what you have learned to create your own stuff. Go ahead and try this assignment: add a new action state that forms a combo of Attack1 and Attack2.

This practice will not be finished in this article, we will keep introducing features of PAT while helping you complete this task.


Find Attack2

Find again. Click onto Attack2.

In practice 0, we've implemented that if you left click your mouse, the penguin will always perform Attack2. It is not what we expected. We want to build a combo, which means the first click to trigger Attack 1, and the second click to trigger Attack 2.

Add Requirement Tag to Attack2

Now Attack2 has only one requirement apart from the input: the Idle Tag. As long as there is an Idle Tag in the Tag Container, Attack 2 is valid for triggering.

Why does Attack2 override Attack1?

In MoveSet, the actions are checked in a fixed order, from top to down in Hierarchy.

In this case, Attack 2 compares its Input Tag with tags in Tag Container first, and successfully grabs the Light Attack tag from it. When checking Attack 1, there is no Light Attack tag anymore and it will not be triggered.

In short, they have different priority so Attack 2 will always be triggered before Attack 1. By dragging Attack 1 above Attack 2, you can find now it is Attack 1 which is triggered every time.

To fix this, we want to add an additional Require Tag to Attack2 which is only granted while the character is performing Attack1.

Add an inner element to the Require Tags of Attack2, select it to be Chain1.

Add Main Tag to Attack1

Now Attack2 requires another Chain1 Tag. If you play the game now, the character will do Attack1 again and Attack2 cannot be triggered, because nothing is granting Chain 1 Tag to the character. We want to make Attack1 grants this tag so Attack2 can form a combo with it.

As all Tags in Main Tags will be added to the Tag Container when that Action State is triggered, we can add Idle & Chain 1 to Attack1's Main Tag. Now it allows Attack2 get triggered.

But there is another problem: you can trigger Attack2 at any time during Attack1.

This makes the game feels weird. The animation of slash in Attack1 might not even started before moving on to Attack2. As a game developer, you want something more fluent. It requires a more precise control over the Action States. That leads us to the next Step: State Modifiers.

For the difference of inner elements and outer elements within Require Tags, you can find more details in Action State .

SwordMoveset
Inspector Details
Add Chain 1 to Attack2