Unit System
  • WELCOME
    • πŸ‘‹Hello
    • πŸ—ΊοΈRoadmap
    • ⛑️Support & Community
    • πŸŽ“Version - Changelog
  • Getting Started
    • πŸ”ŒImport Package
    • βš™οΈConfiguration
    • πŸ” Database
    • πŸͺŸManager Window
    • Creating a new Scene
      • Player Camera
      • Set up Player
      • Set up Player UI
      • Set up the Game World
    • Create Units
      • Resource (Crystal)
      • Research (Crystal age)
      • Resource node (Crystal Node)
      • Resource collector (Crystal)
      • Combat unit (Mage)
      • Production unit (Mage Tower)
      • Faction (Purple Cubes)
  • How it works
    • Overview
    • Modules
      • Resource
      • Production
      • Population
      • Garrison
      • Collection
  • Integration
    • Unit Selection
    • Unit Formation
    • Object Placement
Powered by GitBook
On this page
  • Add resource nodes
  • Add enemy entities
  • Define Enemy Faction units
  • Drag units into the scene
  • Dynamic spawning (waves)
  1. Getting Started
  2. Creating a new Scene

Set up the Game World

Now that the player can spawn and control his units. You can proceed with adding other objects in the scene. Here are two examples

Add resource nodes

Adding resource nodes to the scene will add option for your collectors to gather resources.

  1. You can do this simply by dragging the prefabs for resource nodes into the scene.

  2. Make sure they have the correct layer for selection/interaction.

  3. Now your units are able to collect those resource nodes!

Add enemy entities

To add enemy units, first you need to create Player again but this time for the enemy, and without selection, interaction or UI. Player by itself has no behaviour logic, those are managed by it's modules.

Units are controlled through Combat module; when they are to engage other units. Make sure this Module is present on the enemy player.

Now drag the Player prefab into the scene and assign it a Faction. This will now be our enemy player.

Define Enemy Faction units

One way to spawn units for the new Player is to define it's starting faction units and position it's spawn points as you like. This will make these units spawn on game start on the defined spawn point.

  1. Define Player's Faction starting units

  2. Configure Player's Unit Spawner

Drag units into the scene

  1. Drag into the scene desired entities or units.

  2. Assign player Owner (Player) to the added entities, this makes sure Player is properly managing it's own units.

Dynamic spawning (waves)

You can use the demonstration script WavesManager to create simple waves of enemies with another Player as a target. This dynamically spawns pre-defined units and commands their attacks when units have no active task.

  1. Create empty object

  2. Add Waves Manager component, this will also add it's required Wave Unit Spawner.

    1. Set Target Player, which waves of units will attempt to destroy

    2. Set Bot Player, which is our enemy player

    3. Configure times to your liking

    4. Set up units that will be spawned in a wave and their numbers

  3. Configure Wave Unit Manager by adding spawn points, this specifies where waves will be spawned.

PreviousSet up Player UINextCreate Units

Last updated 1 month ago