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
  • Effect Creation
  • Create an Effect via ScriptableObject
  • Create Effect via Factory
Edit on GitHub
  1. Tutorial
  2. Effect

Create an Effect

PreviousEffectNextApply Effects

Last updated 6 months ago

Effect Creation

To create an Effect, you can either create a ScriptableObject asset in your project or implement your own custom Effect by inheriting from the appropriate class. Just like action state, effect themselves don't do anything, you need to add Effect Component to make them impact gameplay.

Create an Effect via ScriptableObject

Using ScriptableObjects is preferred for prototyping and designing game logic. You can find many mods, such as Add Effect or Add Effect On Hit, created this way. Attack with hitbox also can use effect directly from scrtipable object.

Once created an effect, you will see this

MainTags: character owning this effect will have those tag as long as this effect stays

InfoTags: for Effect Components to communicate

Applied Time, Source, Target: will automaically been set in the process

To add an Effect Component, you select the type in dropdown first, then click the add button

EffectModValue: modify the value of an Attribute in different ways. This can be used for damage, but also used for something like speed control.

EffectLifeControl: how long will the effect stay on a character

EffectKnockBack: the target of this effect will be knocked backed, if that's a character

EffectHitboxInfo: Hitbox will add this to damage effect inorder to pass some extra information

EffectHoldLaw: this effect will contains extra attributelaw, we will talked about attribute law latter.

Create Effect via Factory

Some scripts, like Attack with Hitbox, can get effect from factory:

By this, you don't need to create tons of scriptable object for different attacks. You simply record the data here and an Effect with all thos setting will be created in run time.

We encourgae you to use Factory for some script that want to apply effects dynamically. You can also write your own Factory by overriding the orignal abstract class.

Current Effect Component we provided
All subclass of EffectFactory will be in the list
As you selected the Factory, some property of Effect generation will be exposed to you
How Effect Factory Looks like in code