ORK Framework Logo - RPG Editor for Unity
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

2D RPG Quickstart

  • START 2D RPG Quickstart
  • 01 Initial Setup
  • 02 Player Setup
  • 03 Music & Scenes
  • 04 UI System Setup
  • 05 UI Boxes
  • 06 Flying Texts
  • 07 Status Values
  • 08 Status Effects
  • 09 First Abilities
  • 10 Fighter Setup
  • 11 First Enemies & Battle AI
  • 12 Battle System Setup
  • 13 Animating Battle Start and End
  • 14 Random Battles
  • 15 Animating Actions
  • 16 Player Battle HUD
  • 17 Elemental Attacks
  • 18 Animating More Actions
  • 19 Inventory & Loot
  • 20 Equipment
  • 21 Loot, Start Equipment & Viewers
  • 22 Magic Abilities
  • 23 Caster Setup
  • 24 More Enemies
  • 25 Start Menu & Save Games
  • 26 Menu Screens
  • 27 Interactions
  • 28 Item Collectors
  • END 2D RPG Quickstart

3D RPG Quickstart

  • START 3D RPG Quickstart
  • 01 Initial Setup
  • 02 Player Setup
  • 03 Music & Scenes
  • 04 UI System Setup
  • 05 UI Boxes
  • 06 Flying Texts
  • 07 Status Values
  • 08 Status Effects
  • 09 First Abilities
  • 10 Fighter Setup
  • 11 First Enemies & Battle AI
  • 12 Battle System Setup
  • 13 Animating Battle Start and End
  • 14 Random Battles
  • 15 Animating Actions
  • 16 Player Battle HUD
  • 17 Elemental Attacks
  • 18 Animating More Actions
  • 19 Inventory & Loot
  • 20 Equipment
  • 21 Loot, Start Equipment & Viewers
  • 22 Magic Abilities
  • 23 Caster Setup
  • 24 More Enemies
  • 25 Start Menu & Save Games
  • 26 Menu Screens
  • 27 Interactions
  • 28 Item Collectors
  • END 3D RPG Quickstart

Status System Setup

  • START Status System Setup
  • 01 Status Values
  • 02 Status Development
  • 03 Attack/Defence Modifiers
  • 04 Status Effects
  • 05 Formulas
  • 06 Ability & Item Types
  • 07 Abilities Part 1: Attacks
  • 08 Abilities Part 2: Support & Sabotage
  • 09 Abilities Part 3: Elemental Magic
  • 10 Items
  • 11 Equipment Part 1: Slots & Slot Set Templates
  • 12 Equipment Part 2: Weapons
  • 12.5 (Optional) Equipment Part 2.5: Weapons
  • 13 Equipment Part 3: Shields, Armor & Accessories
  • 13.5 (Optional) Equipment Part 3.5: Shields, Armor & Accessories
  • 14 Equipment Part 4: Available Equipment Templates
  • 15 Loot
  • 16 Battle AIs
  • 17 Combatants Part 1: General Settings
  • 18 Combatants Part 2: Players
  • 19 Combatants Part 3: Enemies
  • 20 Combatant Groups
  • END Status System Setup

3D RPG Playground

  • START 3D RPG Playground
  • 01 Player Setup
  • 02 Start Menu
  • 03 First Interaction
  • 04 Music
  • 05 Areas
  • 06 Collecting Items
  • 07 Displaying Equipment
  • 08 Combatant Prefabs, Icons & Portraits
  • 09 Combatant Animations
  • 10 Camera Positions
  • ANIM 01 Battle Start/End Schematics
  • ANIM 02 Use, Cast & Camera
  • ANIM 03 Abilities & Items
  • ANIM 04 Physical Attacks
  • ANIM 05 Special Actions
  • BATTLE 01 Battle Menu
  • BATTLE 02 Prepare for Battle
  • TURN 01 Turn Based Setup
  • TURN 02 Turn Order HUD
  • ATB 01 Active Time Setup
  • ATB 02 Cast Times
  • ATB 03 Timebar HUD
  • BATTLE 03 The First Battle
  • BATTLE 04 Hunting Move AI
  • BATTLE 05 Spawning Combatants
  • 11 Save Games
  • MENU 01 UI Boxes
  • MENU 02 Template HUDs
  • MENU 03 Overview Menu
  • MENU 04 Menu Screens
  • 12 Shop
  • BATTLE 06 Random Battles
  • DUNGEON 01 Enter the Dungeon
  • DUNGEON 02 The Trapdoor
  • DUNGEON 03 Enemies on Level 1 & 2
  • DUNGEON 04 Traps on Level 3
  • DUNGEON 05 Going Deeper
  • 13 Bestiary (+MENU+ANIM)
  • QUEST 01 Hunting Quests (+MENU)
  • QUEST 02 Guard NPC
  • QUEST 03 Forest Ruin Cheese
  • QUEST 04 Witch NPC with Cheese
  • QUEST 05 Quest Mark HUDs
  • 14 Research Trees (+MENU)
  • CRAFT 01 Crafting Materials
  • CRAFT 02 Crafting Recipes
  • CRAFT 03 Crafting Menu
  • CRAFT 04 Crafting Proficiency & Critical Crafting
  • CRAFT 05 Materials Loot
  • 15 Changing Choice Dialogue
  • 16 Follow Me!
  • BATTLE 07 Sequence Loot Dialogue

3D Action RPG

  • START 3D Action RPG
  • 01 Status System Setup
  • 02 Player Setup
  • 03 Player Weapon
  • 04 Player Attacks
  • 05 Enemy: Chomper
  • 06 Chomper Attack
  • 07 Hit & Death
  • 08 HUDs
  • 09 Rolling on the Floor
  • 10 Enemy: Spitter
  • 11 Spit Attack
  • 12 Potion
  • 13 Grenade
  • 14 Item HUD
  • 15 Enemy: Grenadier
  • 16 Grenadier Melee Attacks
  • 17 Grenadier Flamethrower
  • 18 Item Drops
  • END 3D Action RPG

2D Grid Battle RPG

  • START 2D Grid Battle RPG
  • 01 Player Setup
  • 02 Prefab & Music Setup
  • 03 Randomizing Combatants
  • 04 UI Setup
  • 05 Battle Start, End & Phase Schematics
  • 06 Battle System Setup
  • 07 Battle Grid Setup
  • 08 Grid Move
  • 09 Forest Battle Grid
  • 10 Battle AI
  • 11 Ability Ranges
  • 12 Death & Use Schematics
  • 13 Attack Schematic
  • 14 Shoot Schematics
  • 15 Battle Selection Interaction
  • END 2D Grid Battle RPG

Schematics

  • Simple Start Schematic
  • Battle Start Schematic
  • Battle End Schematic
  • Moving to Target and Back
  • Animating a Base Attack
  • Animating a Magic Ability
  • Grid Movement
  • Open and Close UI Animations
  • Flying Text Mover

UI Setups

  • Unity UI: Initial Setup
  • Unity UI: TextMesh Pro Setup
  • Unity UI: UI Box
  • Unity UI: Flying Text
  • Unity UI: Dragging Notification
  • Unity UI: Canvas with Screen Space Camera
  • Unity UI: Interaction HUD
  • Unity UI: Simple Player HUD
  • Unity UI: Quest HUD
  • Unity UI: Shortcuts HUD
  • Unity UI: Currency HUD
  • Unity UI: Tooltip HUD
  • Unity UI: Control HUD
  • Unity UI: Attack Modifiers
  • Unity UI: Defence Modifiers

Gameplay Bits

  • Combining Input Origins
  • Combining Status Value Flying Texts
  • Fun With Flying Text
  • HUD Effects With Conditional Schematics
  • Inventory Containers
  • Multi Interaction Controllers
  • World Space HUD
  • World Space Dialogue
  • Home
  • Guide
  • Tutorials
  • 2D RPG Quickstart
  • 15 Animating Actions

15 Animating Actions

Table of Contents
  • Move Forward Schematic
    • Change Position
      • Target Position
      • Movement Settings
  • Move Back Schematic
    • Settings
      • Actors
    • Change Position
      • Target Position
      • Movement Settings
  • Enemy Flash Schematic
    • Change Color
    • Change Color
  • Attack Schematic
    • Settings
      • Prefabs
    • Combatant Animation
    • Change Variables
    • Play Sound
    • Spawn Prefab
    • Wait
    • Calculate Action
    • Wait
    • Change Variables
    • Combatant Animation
  • Default Battle Animations
    • Battle Settings > Default Battle Animations
      • Ability Start Animation
      • Ability End Animation
      • Item Start Animation
      • Item End Animation
  • Abilities
    • 0: Attack
      • Battle Animation
    • 1: Poison Attack
      • Battle Animation
    • Save Changes
  • Testing

In this tutorial we’ll set up schematics to animate our battle actions.

Battle actions like abilities or items are animated using schematics – and they can use multiple schematics to do so. We’ll split most of our actions into multiple schematics to have them available as modular parts to reuse and combine as needed.

All our actions will perform in a similar way. The player combatants will step forward, do their action and step back. The enemy combatants will flash twice and do their action. Schematics used to animate battle actions will have the user of the action available as Machine Object and the target(s) as Starting Object.

We’ll now set up 4 schematics:

  • move forward (player)
  • move back (player)
  • enemy flash
  • attack

Afterwards, we’ll set up default animations that are used before each ability/item and the battle animations of our already added abilities.

Let’s get to it.

Move Forward Schematic #

We’ll start with the schematic to move the user of the action forward (in local space of the combatant). In schematics animating actions, the Machine Object is the user of the action.

Open the Makinom editor and navigate to Schematics.

Change Position #

Add Node > Movement > Movement > Change Position

This node is used to set or move a game object to another position. We’ll use it to move the user forward.

  • Moving Object
    Select Machine Object.
    This is the user of the battle action.
  • Move Component
    Select Auto.

Target Position #

  • To Object
    Disable this setting.
    We don’t move to an object.
  • Vector3 Type (Position)
    Select Value > Value.
  • Value
    Set to X=1, Y=0, Z=0.
  • Local Space
    Enable this setting.

Movement Settings #

  • Move
    Enable this setting.
    We’ll move the combatant’s game object – when disabled, the node would set the position immediately.
  • Wait
    Enable this setting.
    The schematic will wait for the movement to finish.
  • Time
    Select Value > Value.
    Set the value to 0.3.
  • Interpolation
    Select Quadratic > Quadratic In + Out.

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as MoveForward.

Move Back Schematic #

This schematic will move the combatant back to the battle spot.

Create a new schematic.

Settings #

We’ll add an actor to this schematic – actors can be used as game objects in object selections of the schematic or e.g. as speaker of a dialogue.

There is a wide range of different types of actors available, we’ll use the action user’s battle spot.

Actors #

Click on Add Actor.

  • Actor Type
    Select User Base.
    This’ll use the battle spot of the user of the action (Machine Object).

Change Position #

Add Node > Movement > Movement > Change Position

We’ll move to the User Base actor’s position.

  • Moving Object
    Select Machine Object.
  • Move Component
    Select Auto.

Target Position #

  • To Object
    Enable this setting.
    This time we move to a game object.
  • Object
    Select Actor 0: User Base.

Movement Settings #

We’ll move just like in the Move Forward schematic.

  • Move
    Enable this setting.
  • Wait
    Enable this setting.
  • Time
    Select Value > Value.
    Set the value to 0.3.
  • Interpolation
    Select Quadratic > Quadratic In + Out.

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as MoveBack.

Enemy Flash Schematic #

This time will flash the action’s user twice.

Create a new schematic.

Change Color #

Add Node > Animation > Fade > Change Color

We’ll flash the Machine Object‘s game object to a light gray color.

  • Color Type
    Select Renderer.
    We’ll change the color of the game object’s renderers.
  • Fade
    Select Flash.
  • Wait
    Enable this setting.
  • Time
    Select Value > Value.
    Set the value to 0.25.
  • Fade Alpha/Red/Green/Blue
    Enable these settings.
  • Start Color
    Set to a white color with full alpha (e.g. A=1 or A=255, depending on the color picker).
  • End Color
    Set to a gray color with full alpha (e.g. R/G/B=0.4 or R/G/B=100, depending on the color picker).
  • Object (Game Object)
    Select Machine Object.
  • Scope
    Select All In Children.
    This’ll use the renderers of the game object and all child objects.

Change Color #

Add Node > Animation > Fade > Change Color

Copy the previous Change Color node.

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as EnemyFlash.

Attack Schematic #

Next, we’ll set up the schematic to animate our attacks.

It’ll play the attack animation, spawn a prefab on the target and calculate the damage of the action. We’ll additionally set an object variable on the user to show the equipped weapon (we’ll set that up later).

Since our attack animation is set up to play until stopped, we also need to stop the animation at the end.

Create a new schematic.

Settings #

We’ll add a prefab for the damage effect – some abilities will override the prefab with a custom one (e.g. poison attack).

Prefabs #

Click on Add Prefab Resource.

  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 0.55.
  • Prefab
    Select the Slash prefab.
    You can find it in Assets/Tutorial Assets/Prefabs/Effects/.

Combatant Animation #

Add Node > Animation > Combatant > Combatant Animation

We’ll play the Attack animation on the user (Machine Object).

Our attack animation will set a bool parameter, playing until we stop it.

  • Object
    Select Machine Object.
  • Animation Type
    Select Attack.

Change Variables #

Add Node > Value > Variable > Change Variables

We’ll now enable the showWeapon bool variable on the user (Machine Object), this’ll show it’s weapon using an Equipment Viewer component (we’ll set up equipment later).

Click on Add Variable.

  • Variable Key
    Set to showWeapon.
  • Variable Origin
    Select Object.
    We use object variables on the user.
  • Object
    Select Machine Object.
  • Type
    Select Bool.
  • Bool Type
    Select Value.
  • Bool Value
    Enable this setting.

Play Sound #

Add Node > Audio > Audio > Play Sound

Play the Attack sound type on the user.

  • Object (Play On)
    Select Machine Object.
  • Use Sound Type
    Enable this setting.
  • Sound Type
    Select Attack.
  • Play One Shot
    Enable this setting.

Spawn Prefab #

Add Node > Game Object > Prefab > Spawn Prefab

We’ll spawn the prefab on the target (Starting Object).

  • Prefab
    Select Prefab 0.
  • Target Type
    Select Object.
  • Object (Target Object)
    Select Starting Object.

Wait #

Add Node > Base > Wait

We’ll wait shortly.

  • Time
    Select Value > Value.
    Set the value to 0.5.

Calculate Action #

Add Node > Battle > Action Outcome > Calculate Action

We now calculate the outcome of the action.

No further settings needed.

Wait #

Copy the previous Wait node, we just wait for another 0.5 seconds.

Change Variables #

We’ll disable the showWeapon bool variable on the user (Machine Object).

Copy the first Change Variables node and change the following setting.

  • Bool Value
    Disable this setting.

Combatant Animation #

Copy the first Combatant Animation node – we now stop playing the Attack animation on the user (Machine Object).

Change the following setting.

  • Stop
    Enable this setting.

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as Attack.

Default Battle Animations #

Now, we’ll use the move/flash schematics to set up some default battle animations that’ll be used before and after each ability and item. In case an ability or item shouldn’t use them, they can be disabled for that individual ability/item.

Navigate to Combatants > Combatants > General Settings.

Battle Settings > Default Battle Animations #

These settings handle the default battle animations (using schematics) for special actions, e.g. a combatant’s death or defending. Each combatant can optionally override the default animations.

We’ll set up battle animations that will be used before and after each ability and item, using the move forward/back schematics for the player and the enemy flash schematic for the enemy (only before the ability/item).

Ability Start Animation #

These battle animations are used before an ability’s battle animations.

Click on Add Battle Animation.

  • Schematic Asset
    Select the MoveForward schematic.

The Used By settings define which combatants will use the schematic.

  • Player/Ally
    Enable these settings.
  • Enemy
    Disable this setting.

Click on Add Battle Animation again, now it’s time for the enemy.

  • Schematic Asset
    Select the EnemyFlash schematic.
  • Player/Ally
    Disable these settings.
  • Enemy
    Enable this setting.

Ability End Animation #

These battle animations are used after an ability’s battle animations.

Click on Add Battle Animation.

  • Schematic Asset
    Select the MoveBack schematic.
  • Player/Ally
    Enable these settings.
  • Enemy
    Disable this setting.

Item Start Animation #

We’ll use the same setup as the Ability Start Animation – so why not just copy and paste it here?

You can do this using the context menu – right/context-click on the Ability Start Animation foldout’s title and select Copy to Clipboard.

The copied settings are highlighted, so you know which settings are included.

Now, right/context-click on the Item Start Animation foldout’s title and select Paste from Clipboard.

This’ll paste the settings as they where when copied.

Item End Animation #

Again, the same setup as in the Ability End Animation settings – so copy/paste them as well.

Abilities #

Next, we’ll update our Attack and Poison Attack abilities to use the Attack schematic.

Navigate to Status > Abilities and select the Attack ability first.

0: Attack #

We’ll just use the Attack schematic as it is, so all we need to do is add a battle animation using it.

Battle Animation #

The Use Start Animation and Use End Animation settings manage if the abiltiy start/end animations are used.

Click on Add Battle Animation.

  • Schematic Asset
    Select Attack.

1: Poison Attack #

The poison attack will override the prefab of the schematic.

This is called asset override and allows to reuse schematics for different use cases, replacing the used assets – e.g. spawning other prefabs, playing other audio clips, etc.

Battle Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select Attack.

The Prefab Settings let us override the prefab of the schematic.

  • Set Prefabs
    Enable this setting.
  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 0.55.
  • Prefab
    Select the SmokePurple prefab.
    You can find it in Assets/Tutorial Assets/Prefabs/Effects/.

Save Changes #

And that’s it!

Save the changes using the Save Settings button at the bottom of the editor.

Testing #

Hit play in the Forest (or Town) scene and trigger a random battle by running around the forest.

Great, the attacks are now animated!

 

Next, we’ll add the battle HUD to know the state of our player.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on March 7, 2023
Table of Contents
  • Move Forward Schematic
    • Change Position
      • Target Position
      • Movement Settings
  • Move Back Schematic
    • Settings
      • Actors
    • Change Position
      • Target Position
      • Movement Settings
  • Enemy Flash Schematic
    • Change Color
    • Change Color
  • Attack Schematic
    • Settings
      • Prefabs
    • Combatant Animation
    • Change Variables
    • Play Sound
    • Spawn Prefab
    • Wait
    • Calculate Action
    • Wait
    • Change Variables
    • Combatant Animation
  • Default Battle Animations
    • Battle Settings > Default Battle Animations
      • Ability Start Animation
      • Ability End Animation
      • Item Start Animation
      • Item End Animation
  • Abilities
    • 0: Attack
      • Battle Animation
    • 1: Poison Attack
      • Battle Animation
    • Save Changes
  • Testing
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (60)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (130)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!