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

30
  • 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

30
  • 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

24
  • 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

53
  • 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

20
  • 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

17
  • 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

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

UI Setups

16
  • 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: Battle Actions 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

13
  • 2.5D Setup
  • Body Part Weakpoint
  • Click Attack
  • Combining Input Origins
  • Combining Status Value Flying Texts
  • Fun With Flying Text
  • HUD Effects With Conditional Schematics
  • Inventory Containers
  • Local Multiplayer
  • Multi Interaction Controllers
  • Target Selection Lines
  • World Space HUD
  • World Space Dialogue
  • Home
  • Guide
  • Tutorials
  • 2D Grid Battle RPG
  • 13 Attack Schematic

13 Attack Schematic

In this tutorial we’ll continue setting up schematics to animate battle actions.

This time we’ll only handle the close range melee attacks, which all use the same schematic. We’ll use sound types to play an attack and hit sound, so we need to set that up as well. Since that’s not that much to do, we also let damaged combatants flash red when they receive damage (that’s set up in the flying texts for HP) and update the use cost texts, which currently show the full status value name (Magic Points) instead of it’s short name (MP).

We’ll set up:

  • sound types
  • combatant sounds
  • attack schematic
  • update attack abilities
  • HP damage flash
  • use cost texts

Let’s get to it.

Sound Types #

Sound types are used to play sounds without knowing (or caring) which actual sound will be played. Combatants, equipment and other things (including Sound Assignment components) can define which sound is played for which type – this allows us to e.g. play an attack or hit sound in our attack schematic, and the actual sound can depend on which combatant attacks (and which weapon they have equipped) and who’s hit by the attack (and maybe which kind of armor they wear). We’ll only use a default sound setup for this tutorial, though.

You can learn more about sound types in this Makinom documentation.

Navigate to Base/Control > Sound Types, we’ll change the Default type and add an additional type.

0: Attack #

  • Name
    Set to Attack.

1: Hit #

  • Name
    Set to Hit.

Combatant Sounds #

We’ll set up default attack and hit sounds for all combatants.

Navigate to Combatants > Combatants > General Settings.

Animation & Movement > Sound Settings #

Click on Add Sound.

  • Sound Type
    Select Attack.
  • Audio Clip
    Select the Sword2 audio clip.

Click on Add Sound.

  • Sound Type
    Select Hit.
  • Audio Clip
    Select the Hit audio clip.

Save Changes #

That’s it for the editor setup for now, we’ll continue with schematics.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Attack Schematic #

Like with use and death, the Attack animation also plays until we stop it, so we need to play and stop it in the schematic. We’ll also change the user’s showWeapon bool variable to let it’s equipment viewer show the weapon during attacks.

Additionally, we need to handle the direction of our animations – the attack animation has different versions for north, south, east and west directions. We already handle this automatically via the combatant’s rotation. So, what do we do to make use of that? We let the user face the target!

Navigate to Schematics and start working on a new schematic.

Settings #

We’ll add a prefab that’ll spawn to animate the attack.

Prefabs #

Click on Add Prefab Resource.

  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 0.55.
  • Prefab
    Select Slash.

Rotate To #

Add Node > Movement > Rotation > Rotate To

This node rotates a game object to face another game object or position.

We’ll use it to rotate the user (Machine Object) to face the target (Starting Object), which takes care of our directional animations.

  • Is 2D
    Enable this setting.
    This makes sure the 2D look at rotation is correct.
  • Object (Rotating Object)
    Select Machine Object.
  • Rotate Component
    Select Transform.
  • Rotate Function
    Select Set.
  • Is 2D Look At
    Enable this setting.
    This isn’t really needed, as the Is 2D setting already takes care of this and this node uses a different rotation function. But it doesn’t hurt to do this for 2D.
  • Rotation Target
    Select Game Object.
  • Object (Rotation Target)
    Select Starting Object.

Wait #

Add Node > Base > Wait

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

Combatant Animation #

Add Node > Animation > Combatant > Combatant Animation

We’ll play the Attack animation. As said, the attack animation will play until we stop it, so we don’t need to wait for 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, this’ll show it’s weapon via the Equipment Viewer (as we set up).

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

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

Calculate Action #

Add Node > Battle > Action Outcome > Calculate Action

We now calculate the outcome of the action.

No further settings needed.

Play Sound #

Add Node > Audio > Audio > Play Sound

Play the Hit sound type on the target.

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

Wait #

Copy the first Wait node (0.5 second wait).

Change Variables #

Copy the previous Change Variables node, we now disable the showWeapon bool variable.

  • Bool Value
    Disable this setting.

Combatant Animation #

Copy the previous Combatant Animation node.

We’ll now stop playing the Attack animation.

  • Stop
    Enable this setting.

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

Abilities #

Next, we’ll use the schematic to animate our attack abilities.

Navigate to Status > Abilities.

0: Attack #

Battle Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select the Attack schematic.

2: Poison Attack #

Battle Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select the Attack schematic.

We’ll replace the prefab in the Resource Overrides settings.

Click on Add Prefab Override.

  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 0.55.
  • Prefab
    Select SmokePurple.

3: Slow Attack #

Battle Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select the Attack schematic.

We’ll replace the prefab in the Resource Overrides settings.

Click on Add Prefab Override.

  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 1.1.
  • Prefab
    Select ShieldBlue.

4: Blind Attack #

Battle Animation #

Click on Add Battle Animation.

  • Schematic Asset
    Select the Attack schematic.

We’ll replace the prefab in the Resource Overrides settings.

Click on Add Prefab Override.

  • Auto Destroy After Time
    Enable this setting.
  • Time
    Set to 0.55.
  • Prefab
    Select Smoke.

Damage Flash #

Next, we’ll setup up a red flash on a damaged combatant’s game object. This is done in the HP status value’s flying text settings.

Navigate to Status > Status Values and select the Health Points status value.

UI Settings > Flying Text Settings > Flying Text 0 #

We need to add the red flashing to the Damage and Critical Damage settings, since we already have set up using different versions in the status system setup tutorials.

Damage > Flash Settings #

  • Use Flash
    Enable this setting.
  • Flash Children
    Enable this setting.
    This’ll also change the color of renderers on child objects.
  • Time
    Set to 0.5.
  • Fade Alpha/Red/Green/Blue
    Enable these settings.
  • Start Color
    Select a white color with full alpha (i.e. A=255 or 1, depending on the color picker).
  • End Color
    Select a red color with full alpha (i.e. A=255 or 1, depending on the color picker).

Critical Damage > Flash Settings #

We use the same setup, but do a longer flash.

  • Use Flash
    Enable this setting.
  • Flash Children
    Enable this setting.
  • Time
    Set to 1.
  • Fade Alpha/Red/Green/Blue
    Enable these settings.
  • Start Color
    Select a white color with full alpha (i.e. A=255 or 1, depending on the color picker).
  • End Color
    Select a red color with full alpha (i.e. A=255 or 1, depending on the color picker).

Update Use Cost Text #

And lastly, we update the use costs to show short names (MP) instead of the regular names (Magic Points) of the status values.

Navigate to UI > Text Display Settings.

Status Texts > Use Cost Display #

These settings manage how use costs will be displayed in menus. We’ll only change the status value texts.

Negative Change Text #

  • Default Content
    Set to: <shortname> <change>

Positive Change Text #

  • Default Content
    Set to: <shortname> +<change>

Set Change Text #

  • Default Content
    Set to: <shortname> =<change>

Save Changes #

And that’s it for the attack animations!

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Testing #

Hit play in the Forest Battle 1 scene and hit some enemies.

And it’s working – weapons are shown, sounds play and prefabs spawn, great!

 

Next, we’ll set up the bow attack schematics.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on April 7, 2023
Table of Contents
  • Sound Types
    • 0: Attack
    • 1: Hit
  • Combatant Sounds
    • Animation & Movement > Sound Settings
  • Save Changes
  • Attack Schematic
    • Settings
      • Prefabs
    • Rotate To
    • Wait
    • Combatant Animation
    • Change Variables
    • Play Sound
    • Spawn Prefab
    • Wait
    • Calculate Action
    • Play Sound
    • Wait
    • Change Variables
    • Combatant Animation
  • Abilities
    • 0: Attack
      • Battle Animation
    • 2: Poison Attack
      • Battle Animation
    • 3: Slow Attack
      • Battle Animation
    • 4: Blind Attack
      • Battle Animation
  • Damage Flash
    • UI Settings > Flying Text Settings > Flying Text 0
      • Damage > Flash Settings
      • Critical Damage > Flash Settings
  • Update Use Cost Text
    • Status Texts > Use Cost Display
      • Negative Change Text
      • Positive Change Text
      • Set Change Text
  • 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 (62)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (138)
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!