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

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK 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
    • This Is Not The End
    • Quickstart Extended
      • Unity UI: Interaction HUD
  • Schematics Tutorials
    • UI Animation Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Interaction HUD

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • ORK 4 Unity Quickstart Tutorials (3D)

15 Animating Actions

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 combatants will step forward, do their action and step back. 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 3 schematics:

  • move forward
  • move back
  • attack

Afterwards, we’ll set up animations that are used before each ability/item (i.e. stepping forward and back) 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 schematic editor.

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
    We don’t move to an object.
  • Vector3 Type (Position)
    Select: Value > Value
  • Value
    Set to: X=0, Y=0, Z=1
    This is forward in local space of the object.
  • Local Space
    Enable
  • Ignore Scale
    Enable

Movement Settings #

  • Move
    Enable
    We’ll move the combatant’s game object – when disabled, the node would set the position immediately.
  • Wait
    Enable
    The schematic will wait for the movement to finish.
  • Apply Gravity
    Enable
    The movement will also include gravity, i.e. sticking to the ground.
  • 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 using the +-button in the upper left corner of the editor.

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

Target Position #

  • To Object
    Enable
    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
  • Wait
    Enable
  • Apply Gravity
    Enable
  • 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.

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.

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
  • Time
    Set to: 1
  • Prefab
    Select: HitEffect

Play Sound #

Add Node > Audio > Audio > Play Sound

Play the Attack organizer type on the user.

  • Object (Play On)
    Select: Machine Object
  • Use Organizer Type
    Enable
  • Organizer Type
    Select: Attack
  • Play One Shot
    Enable

Combatant Animation #

Add Node > Animation > Combatant > Combatant Animation

We’ll play the Attack organizer type’s animation.

  • Object
    Select: Machine Object
  • Organizer Type
    Select: Attack
  • Wait
    Enable
  • Normalized Time
    Set to: 0.5
    We’ll wait for half of the animation’s duration.
  • Store Duration
    Enable
    We’ll also store the animation’s duration into a float variable and use it afterwards in a Wait node.
  • Normalized Time (Store Duration)
    Set to: 0.5
    We store the remaining duration’s half.
  • Variable Key
    Set to: wait
  • Variable Origin
    Select: Local
    These are local variables of the running schematic and will be gone after it finished.

Spawn Prefab #

Add Node > Game Object > Prefab > Spawn Prefab

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

  • Prefab
    Select: Prefab 0
  • Use Prefab Rotation
    Enable
  • Target Type
    Select: Object
  • Object (Target Object)
    Select: Starting Object
  • Spawn At
    Select: All
    In case an action has multiple targets, this’ll spawn the prefab on all of them.
  • On Child
    Select: Path
  • Find Child
    Set to: Center
    We’ll spawn the prefab at the center of the target’s game object.
    The Center child object is already set up on all combatant prefabs.

Calculate Action #

Add Node > Battle > Action Outcome > Calculate Action

We now calculate the outcome of the action.

No further settings needed.

Wait #

Add Node > Base > Wait

And now we’ll wait for the stored duration.

This node is connected to the Next slot of the Spawn Prefab node and the Miss slot of the Calculate Action node.

  • Time
    Select: Variable > Double Variable
  • Variable Key
    Set to: wait
  • Variable Origin
    Select: Local

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 forward/back 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 Battles > Battle Actions.

Ability Settings #

These settings define default times for abilities and the ability start/end animations.

Ability Start Animation #

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

Click on Add Battle Animation.

  • Schematic Asset
    Select: MoveForward

Ability End Animation #

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

Click on Add Battle Animation.

  • Schematic Asset
    Select: MoveBack

Item Settings #

These settings define default times for items and the item start/end animations.

Item Start Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select: MoveForward

Item End Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select: MoveBack

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.

Animation Settings #

The Use Start Animation and Use End Animation settings manage if the abiltiy start/end animations are used. They are enabled by default, using the start/end animations.

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 assets, etc.

Animation Settings #

Click on Add Battle Animation.

  • Schematic Asset
    Select: Attack

The Resource Overrides settings let us override the prefab of the schematic.

Click on Add Prefab Resource.

  • Auto Destroy After Time
    Enable
  • Time
    Set to: 3
  • Prefab
    Select: PoisonEffect

Save Changes #

And that’s it!

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

Testing #

Hit play and start a battle outside of town.

Great, the attacks are now animated!

 

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

Table of Contents
  • Move Forward Schematic
    • Change Position
      • Target Position
      • Movement Settings
  • Move Back Schematic
    • Settings
      • Actors
    • Change Position
      • Target Position
      • Movement Settings
  • Attack Schematic
    • Settings
      • Prefabs
    • Play Sound
    • Combatant Animation
    • Spawn Prefab
    • Calculate Action
    • Wait
  • Default Battle Animations
    • Ability Settings
      • Ability Start Animation
      • Ability End Animation
    • Item Settings
      • Item Start Animation
      • Item End Animation
  • Abilities
    • 0: Attack
      • Animation Settings
    • 1: Poison Attack
      • Animation Settings
    • Save Changes
  • Testing
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
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!