ORK 4 RPG Framework Logo
  • ORK 4 GUIDE
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 GUIDE
    • Documentation
    • Tutorials
    • 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
    • Quickstart Extended
  • Battle Tutorials
    • Active Time Battles
    • Phase Battles
    • Real TT 01 Real Time Battles & Tab Targeting
    • Real TT 02 Control Map, Use Ranges & Battle Area
    • Real TT 03 Camera Control, Battle AI & Reuse Time
    • Real TT 04 Damage Detection, Action Animation & Player HUD
    • Real TT 05 Switch Player & Final Adjustments
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Reuse Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Control Map for Keyboard (Shortcuts)
    • Control Map for Gamepad (Shortcuts)
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD
    • Menus 01 UI Box Setup
    • Menus 02 Template HUDs
    • Menus 03 Menu Setup
    • Menus 04 Main Menu
    • Menus 05 Inventory
    • Menus 06 Equipment
    • Menus 07 Ability
    • Menus 08 Group
    • Menus 09 Quest
    • Menus 10 Crafting
  • Module 01: Status System
    • Introduction to Modular Tutorials
    • M01.1: Status Values
      • Introduction to Status Values
      • Health
      • Mana
      • Barrier
      • Base Experience
      • Class Experience
      • Spendable Experience
      • Normal Stats
    • M01.2: Modifiers
      • Introduction to Modifiers
      • Element
      • Attack Type
      • Size
      • Race
    • M01.3: Status Effects
      • Introduction to Status Effects
      • Buffs
      • Debuffs
      • Poison
      • Regeneration
      • Blind
      • Stun
      • Sleep
      • Silence
      • Enchants
      • Charm
      • Doom
      • Reflect
  • Module 02: Actions
    • Introduction to Actions
    • M02.1: Formulas
      • Introduction to Formulas
      • Physical Damage Formula
      • Magical Damage Formula
      • Hit Chance
      • Critical Chance
    • M02.2: Abilities
      • Introduction to Abilities
      • Base Attack
      • Elemental Magic Spells
      • Steal Ability
      • Drain
      • Healing Spell
      • Cure
      • Buff Abilities
      • Debuff Abilities

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
  • Gameplay Tutorials

Player Group Spawn & Follow

0:00 / 5:41
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

In this tutorial we’ll spawn the player group members and make them follow the player.

The default setup of an ORK project will only spawn the player outside of battles. Let’s change that to spawn other members of the player’s battle group as well.

Beside spawning the members, we’ll also need a move AI to make them follow their group leader (i.e. the player). We’ll also use a formation to have the members follow defined positions around the player.

We’ll set up:

  • spawning player group members
  • formation
  • move AI to follow the group leader

This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials, but can be used in any project.

Spawning Player Group Members #

Open the ORK editor and navigate to Gameplay > Game Settings, this is where the general player group settings are found.

Player/Group Settings > Group Spawn Settings #

We’ll simply have to turn on spawning group members.

The default setup will spawn only the battle group members, so we make sure that’s what’s set up.

  • Spawn Group
    Enable
  • Whole Group
    Disable
    We only spawn members of the battle group.

You can control the distance they spawn from the player using the Distance setting, but that doesn’t concern us, as we’re using a formation to handle that.

If you test now, the battle group members will spawn with the player, but use the default move AI (if you’ve followed the spawn hunting enemies tutorial), i.e. not follow the player and randomly moving around.

Formation #

Next, we’ll set up the formation the group will move in.

Navigate to Combatants > Formations, we’ll change the Default formation.

  • Name
    Set to: Player Group
  • Place On Ground
    Enable
    This’ll use a raycast to find the ground for our positions.
  • Layer Mask
    Select only the Default layer.
    First select Nothing, then select Default.
    Our ground (and other level architecture) is on the Default layer.

Field Positions #

We’ll define the positions our group members will follow their group leader (i.e. the player) here.

Positions can be created in a visual editor – you can add and remove postions using a right-click and move them around using left-click-dragging.

Add 2 positions like this:

For further precision, you can also edit the positions below the formation graph.

Formation Position 0 #

  • Position
    Set to: X=-1.5, Y=0, Z=-1.5
  • Local Space
    Enable
    This is enabled by default – it makes sure the positions are in local space of the user, i.e. they’ll turn with it.

Formation Position 1 #

  • Position
    Set to: X=1.5, Y=0, Z=-1.5
  • Local Space
    Enable

Battle Positions #

We’re not going to use the formation in battles. If you want to use it, just add positions to it.

When using a formation for battle, only the leader will be placed using the battle spots, the other group members will be placed according to the used formation.

Tip!

Formations are not limited to the player, they can also be used by enemies and other AI controlled groups.

Move AI #

We’ll continue with setting up the move AI for the player group members. Their move AI will only follow their group leader instead of hunting enemies.

Navigate to Combatants > Move AIs and add a new move AI.

  • Name
    Set to: Follow Leader

Group Settings #

These settings manage following the group leader.

  • Follow Leader
    Enable

Follow Range #

We’ll follow the leader at a distance of 3 world units with a threshold of 0.5.

  • Range
    Select: Value > Value.
    Set the value to: 3
  • Threshold
    Select: Value > Value
    Set the value to: 0.5
    This is usually the default threshold.

Give Way #

The combatants can move away from the leader to give them space to move, we’ll use that.

  • Give Way
    Enable
  • Range
    Select: Value > Value
    Set the value to: 1
  • Threshold
    Select: Value > Value
    Set the value to: 0.5
    This is usually the default threshold.

Auto Respawn #

We’ll automatically respawn combatants when they are too far away.

E.g. in case they get stuck somewhere, this’ll reset them.

  • Auto Respawn
    Enable
  • Range
    Select: Value > Value
    Set the value to: 30

Prioritise Leader #

We don’t need to use this, since our combatants will only follow the leader and do nothing else.

In case you want to use random patrol (while they’re not following the leader) or other move AI features for the combatants, this can ensure they’ll follow the leader if they are too far away.

Updating Player Combatants #

We need to set up our player combatants to use the move AI we just created.

Navigate to Combatants > Combatants, we’ll change the following combatants:

  • Fighter
  • Caster

The setup is the same for all combatants.

AI Settings > Move AI #

  • Own Move AI
    Enable
  • Use Move AI
    Enable
  • Move AI
    Select: Follow Leader

Save Changes #

That’s it for the setup so far.

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

Updating Start Game Schematic #

All that’s left to do is actually use the formation we set up. Formations can be used by combatant group setups (Combatants > Combatant Groups), battle AIs and schematics.

We’ll update the Start Game schematic to use the formation.

Open the schematic editor and open the StartGame schematic.

Change Formation #

Add Node > Combatant > Formation > Change Formation

Add the node before the Spawn ORK Player node, otherwise the group members will not already spawn in formation.

  • Formation
    Select: Player Group
  • Object (Combatant)
    Select: Player

And that’s it – click on Save Schematic to save the changes.

Testing #

Hit play to test the changes.

https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__player_group_spawn_demo.mp4

If, like me, you haven’t added more player group members yet, you’ll only have one combatant follow the player for now.

At least the player isn’t alone anymore!

Table of Contents
  • Spawning Player Group Members
    • Player/Group Settings > Group Spawn Settings
  • Formation
    • Field Positions
      • Formation Position 0
      • Formation Position 1
    • Battle Positions
  • Move AI
    • Group Settings
      • Follow Range
      • Give Way
      • Auto Respawn
      • Prioritise Leader
  • Updating Player Combatants
    • AI Settings > Move AI
  • Save Changes
  • Updating Start Game Schematic
    • Change Formation
  • Testing
Sitemap
  • Showcase
  • ORK 4 Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (75)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (158)
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!