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

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: 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
  • Schematics
  • Moving to Target and Back

Moving to Target and Back

Table of Contents
  • Radius
  • Moving To Target
    • Change Position
      • Target Position
      • Movement Settings
  • Move To Base
    • Settings
      • Actors
    • Change Position
      • Target Position
      • Movement Settings
    • Wait
    • Look At Enemies
  • Using the Schematics
    • Battle Animation
  • Alternative: One Step Forward, One Step Back

Create two schematics to move to the target of an attack and back.

In this tutorial we’ll create two simple schematics to animate battle actions. One for moving to the target of an attack, one for moving back to the user’s battle spot.

They can e.g. be used for a base attack, running to the target (1st schematic), attacking the target (other schematic) and moving back to the original position (2nd schematic).

Movement is handled using the Change Position node – the setup described here will use the Auto move component selection. This’ll try to select the appropriate component for movement, but this might not result in the desired outcome for all setups. If movement doesn’t work in your setup, try one of the different move components based on your setup (e.g. Character Controller or Combatant Movement Component).

Radius #

The Radius component can be used to define a radius on your combatants. This radius can be used to calculate distances, e.g. for this tutorial, the stop distance between user and target.

It’s highly recommended to use Radius components on the prefabs of your combatants.

The Radius component can be added via the components menu: Makinom > Scenes > Radius

Moving To Target #

This schematic will move the user of a battle action (e.g. an ability used as base attack) to the action’s target. The user is the Machine Object and the target is the Starting Object of the schematic.

You can download the finished schematic here:

Download Schematic

 

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 to the target, based on the user’s run speed.

  • Moving Object
    Select Machine Object.
  • Move Component
    Select Auto.
    Please note that you might need to use a different selection based on your setup.

Target Position #

  • To Object
    Enable this setting.
  • Object
    Select Starting Object.

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.
  • Apply Gravity
    Enable this setting.
    Depending on your movement component setup, you might need to disable this.
  • Stop Distance
    Set to 0.
    We’ll run up directly to the combatant.
    The actual distance is also determined by the optional Radius components on your combatants.

We’ll also have the combatant look into the movement direction – please note that this is usually only used in 3D games, for most 2D games you don’t want to mess with the rotation.

  • Fade Direction
    Enable this setting.
    The combatant will look into the direction it moves.
    This is usually only used in 3D games.
  • Rotate Component
    Select Auto.
    Please note that you might need to use a different selection based on your setup.
  • Lock Rotation
    Enable X and Z.
    This is used to only rotate on your horizontal rotation axis, in 3D games that’d be the Y-axis, i.e. you want to block rotation on X/Z axes.

We’ll move based on the combatant’s Run speed (set up via the movement settings, either from the combatant general settings or the combatant’s individual settings).

  • Move By Speed
    Enable this setting.
  • Stop At Target
    Enable this setting.
  • Speed Type
    Select Run.
  • Speed
    Select Value > Value.
    Set the value to 5.
    This is used as a fallback move speed in case no run speed could be found.
  • Follow Position
    Enable this setting.
    In case the target moves, the user will keep following it’s new position.

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

Yes, the schematic only consists of a single node that handles all the work for us!

Move To Base #

This schematic will move the user of a battle action (e.g. an ability used as base attack) back to it’s battle spot.

You can download the finished schematic here:

Download Schematic

 

Settings #

We need to add an actor to be able to use the battle spot of the user (Machine Object).

Actors #

Click on Add Actor.

  • Actor Type
    Select User Base.

Change Position #

Add Node > Movement > Movement > Change Position

We’ll move the user back to it’s battle spot. This time, we’ll ignore the radius.

  • Moving Object
    Select Machine Object.
  • Move Component
    Select Auto.
    Please note that you might need to use a different selection based on your setup.

Target Position #

  • To Object
    Enable this setting.
  • Object
    Select Actor 0: User Base.

Movement Settings #

  • Move
    Enable this setting.
  • Wait
    Enable this setting.
  • Apply Gravity
    Enable this setting.
    Depending on your movement component setup, you might need to disable this.
  • Stop Distance
    Set to 0.
  • Ignore Radius
    Enable this setting.
    We want to stop on the battle spot’s position, so we need to ignore the radius of the combatant (optionally defined by it’s Radius component).

We’ll also have the combatant look into the movement direction – please note that this is usually only used in 3D games, for most 2D games you don’t want to mess with the rotation.

  • Fade Direction
    Enable this setting.
    The combatant will look into the direction it moves.
    This is usually only used in 3D games.
  • Rotate Component
    Select Auto.
    Please note that you might need to use a different selection based on your setup.
  • Lock Rotation
    Enable X and Z.
    This is used to only rotate on your horizontal rotation axis, in 3D games that’d be the Y-axis, i.e. you want to block rotation on X/Z axes.

We’ll move based on the combatant’s Run speed (set up via the movement settings, either from the combatant general settings or the combatant’s individual settings).

  • Move By Speed
    Enable this setting.
  • Stop At Target
    Enable this setting.
  • Speed Type
    Select Run.
  • Speed
    Select Value > Value.
    Set the value to 5.
    This is used as a fallback move speed in case no run speed could be found.
  • Follow Position
    Enable this setting.

Wait #

Add Node > Base > Wait

Add a short wait time to make sure the movement is done.

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

Look At Enemies #

Add Node > Battle > Combatant > Look At Enemies

Reset the user’s rotation to look at it’s enemies.

  • Use Combatant
    Enable this setting.
    We’ll only change the rotation of the user, not all combatants.
  • Object
    Select Machine Object.

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

Using the Schematics #

The schematics are used to animate abilities or items in case you want to run up to a target to use the action.

E.g. to animate your base attack ability, navigate to Status > Abilities, select your attack ability and change the following settings.

Battle Animation #

Click on Add Battle Animation to add the schematic for moving to the target.

  • Schematic Asset
    Select the MoveToTarget schematic (or however you named it).
  • Auto Damage Dealers
    Disable this setting.
    In case you use auto damage dealers for dealing damage, you usually don’t want to activate them when running to the target (or back).

Add additional schematics to animate the actual attack (not covered by this tutorial).

Click on Add Battle Animation again to add the schematic for moving back to the battle spot.

  • Schematic Asset
    Select the MoveToBase schematic (or however you named it).
  • Auto Damage Dealers
    Disable this setting.

You can also limit using the schematics to defined battle systems or only use them for the player faction, etc.

In the end, your battle animation will probably have 3 schematics:

  • Battle Animation 0: Move To Target
  • Battle Animation 1: Attack (schematic handling animation, calculating damage, etc.)
  • Battle Animation 2: Move To Base

See this tutorial for an attack schematic setup example.

Alternative: One Step Forward, One Step Back #

You don’t want to run up to the target, but just make a step forward?

Sure – just replace use the Move Into Direction node, moving into the Forward and Back directions (no facing direction needed for this setup). Moving back can also use an additional Change Position node to set the combatant back on it’s battle spot, just to make sure moving forward and back constantly doesn’t move off track over time.

You can download example schematics here:

Download Schematic

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on July 4, 2022
Table of Contents
  • Radius
  • Moving To Target
    • Change Position
      • Target Position
      • Movement Settings
  • Move To Base
    • Settings
      • Actors
    • Change Position
      • Target Position
      • Movement Settings
    • Wait
    • Look At Enemies
  • Using the Schematics
    • Battle Animation
  • Alternative: One Step Forward, One Step Back
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (59)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (129)
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!