A Unity strategy prototype that combines RTS-style unit selection and commands with melee/ranged combat, staged progression, recruitable units, and persistent player squads.
Short video showcasing a very early build:
https://www.youtube.com/watch?v=bBCE_ZFzDKE
This project is being developed in Unity 6000.4.7f1 / Unity 6.4. It is still a prototype, but the core loop now supports selecting units, issuing commands, fighting enemies, recruiting allies, clearing stages, carrying surviving player units forward, and retrying/restarting after defeat.
- RTS-style click and drag-box selection through
PlayerControllerandSelectionManager. - Command routing for selected units via
CommandSystem,UnitCommandReceiver, and command types such as move, attack, and follow. - Unit state and combat behavior in
UnitBrain, including movement, melee, ranged attacks, blocking, following, and conversations. - Melee and ranged combat through
WeaponHitbox,BowWeapon,ArrowProjectile,Hurtbox, andBlockController. - Animation integration through
UnitAnimatorandCombatAnimationEvents. - Player UI and game flow through
GameManager, including pause, game over, restart, and retry stage. - Faction relationships and campaign state through
GameProgressandFactionRelations. - Scene-level faction counts, player defeat, and stage-clear checks through
FactionUnitTracker. - Stage exits through
StageExitTrigger, including objective-gated exits and optional requirements for all living player units to enter the trigger. - Saved player squad spawning through
StageUnitPersistenceandUnitSpawnPoint. - Recruitable allies through
RecruitableUnit. - Environment helpers such as
SeeThroughWindowandBuildingInteriorTrigger.
Player units are saved when advancing through a StageExitTrigger. On the next stage, StageUnitPersistence restores saved units by spawning configured prefabs at UnitSpawnPoint locations.
To set up a stage that receives saved units:
- Add one
StageUnitPersistencecomponent to the scene. - Assign the scene's
FactionUnitTracker. - Add one or more
UnitSpawnPointobjects to the scene. - Add entries to
Unit Prefabs, mapping saved unitPersistent Idvalues to the prefabs that should be spawned.
Each spawn point is used once. If a saved unit has no prefab mapping or there are not enough spawn points, the project logs a warning.
FactionUnitTracker tracks living unit counts per faction. It can:
- trigger game over when the player faction reaches zero units;
- unlock a configured
StageExitTriggerwhen enemies are defeated; - count either a specific enemy faction or all factions hostile to the player.
Units must be assigned to the scene's FactionUnitTracker when they should participate in stage clear or game over logic.
Default behavior is wired through Unity's Input System actions:
- Left click: select a unit.
- Left mouse drag: box-select owned units.
- Additive select action: keep current selection while adding units.
- Right click: issue move, follow, or attack orders.
Player/ToggleRun: toggle running for selected units.Player/ToggleBlock: toggle blocking for selected units.Player/ToggleAutoCombo: toggle auto-combo behavior when available.Player/Stop: stop selected units.Player/EquipSword: equip sword.Player/EquipBow: equip bow.UI/Cancel: pause.
- Open the project with Unity
6000.4.7f1or a compatible Unity 6 editor. - The project uses Unity's Input System and TextMeshPro.
- Scene references are generally assigned manually in the Inspector.
- Unit
Persistent Idvalues are important for saving and restoring carried units. - Unit prefabs spawned by
StageUnitPersistenceshould include the normal unit components, command receiver, selectable setup, AI/brain setup, and visual/animation dependencies expected by that unit type.
- Character and object models were created in Blender and imported into Unity.
- Unity Animator controller state machines and animation logic are included.
- Custom ProBuilder geometry and scene layout assets are present.
- TextMeshPro resources, UI logic, and general Unity project settings are included in the repository.