Companion System

v1.2.0

Getting Started

Set up your scene and summon your first companion in under 5 minutes

Quick Start

This guide walks you from zero to a working companion in your scene. You need a GC2 Character-based player and a companion prefab (also with a GC2 Character).

Step 1
Scene Setup
Step 2
Create Definition
Step 3
Follow Profile
Step 4
Summon

Requirements

The core system needs only Game Creator 2 (core) + the GC2 Characters module. That covers everything most projects use CPS for: follow/formation movement, bonding, commands, vitals, abilities, interest points, idle behavior, reactions, party UI, save/load (GC2 Memory), traits, and targeting. No other GC2 module is required for any of the above.

Two folders are optional integrations, not core dependencies:

FolderRequiresPurpose
Runtime/Bridges/InventoryGC2 Inventory moduleExposes a companion's GC2 Bag for CPS-aware inventory queries (Companion Has Inventory, Companion Has Item)
Runtime/Bridges/StatsGC2 Stats moduleDrives configurable need/attribute decay (hunger, happiness, etc.) with threshold events (Feed Companion, Companion Need Level, On Need Critical)
If you do not own or use the corresponding GC2 module, you can safely delete the entire Runtime/Bridges/Inventory and/or Runtime/Bridges/Stats folder — each is its own assembly, gated by a scripting define that the bridge validator toggles automatically based on which GC2 modules are present in the project. Removing the folder removes the feature cleanly with no dangling references or compile errors elsewhere in CPS. See Components → Bridges for setup details on each bridge.

Example Scenes — Two-Step Import

The demo scenes ship as a nested package at Assets/Plugins/CompanionSystem/Examples/CompanionSystem.Examples/Package.unitypackage. After the main import, locate that file in the Project window and double-click it (or right-click → Import Package) to install the scenes to Assets/Plugins/GameCreator/Installs/CompanionSystem.Examples@<version>/.

This is Game Creator 2's standard sample-package convention — it is not a separate purchase or a mistake, just an extra click.

Scene Setup

Two components are required before companions can be summoned:

1. Add CompanionManager

  1. Create an empty GameObject (name it "CompanionManager")
  2. Add Component → CompanionManager
  3. Mark it DontDestroyOnLoad if your game has multiple scenes
CompanionManager is a singleton. There must be exactly one in the scene. Configure max companion count via Window → Companion System → Settings.

2. Add CompanionOwnerAdapter to Player

  1. Select your Player GameObject
  2. Add Component → CompanionOwnerAdapter

This bridges your GC2 Character to CPS's owner interface. CPS will also add it automatically when you use the Summon instruction with a player target.

Scene Hierarchy (minimum setup):
├── CompanionManager            ← add CompanionManager component
│   └── CompanionRemember       ← (optional) add for save/load
└── Player                      ← your GC2 Character
    └── CompanionOwnerAdapter   ← add this component

Create a CompanionDefinition

A CompanionDefinition is the blueprint for a companion type. Think of it as the "species sheet" — it defines what the companion is and how it behaves.

  1. In the Project window, right-click your desired folder
  2. Select Create → Companion System → Companion Definition
  3. Name it descriptively (e.g., "Dog" or "Warrior_Companion")
  4. Assign your companion prefab in the Prefab field
CompanionDefinition: "MyCompanion"
├── Display Name: "Buddy"
├── Description: "A loyal follower"
├── Category: Pet
├── Icon: (your sprite)
├── Prefab: MyCompanion_Prefab   ← must have GC2 Character
├── Follow Profile: MyFollowProfile
├── Idle Behavior: (optional)
├── Personality: (optional)
├── Reaction Profile: (optional)
└── Command Set: (optional)
Prefab Requirement: The companion prefab must have a GC2 Character component. CPS uses GC2's motion system for all movement.

Set Up a FollowProfile

A FollowProfile controls how the companion follows — distances, speeds, formation behavior. You can set a project-wide default or assign per-companion overrides.

  1. Create via Create → Companion System → Follow Profile
  2. Tune the distances for your game's scale:
PropertyGood Starting ValueWhat It Does
Inner Radius2mStop distance from owner
Outer Radius8mDistance before switching to run speed
Teleport Radius25mDistance before teleporting behind owner
Walk Speed2.5Speed when close to owner
Run Speed5.5Speed when far from owner

Assign the profile to your CompanionDefinition, or set it as the project default in Window → Companion System → Settings.

Summon Your First Companion

With the scene set up and your Definition ready, summon the companion via GC2:

Trigger: On Start
└── Instructions:
    └── Summon Companion
        ├── Definition: MyCompanion
        ├── Spawn Position: (player position)
        └── Owner: Player

What Happens on Summon

  1. Prefab is instantiated at the spawn position
  2. CompanionBrain is initialized with the Definition's profiles
  3. Companion begins following the owner immediately
  4. OnCompanionSummoned event fires
Spawn Position: Companions typically spawn a few meters behind the player. Use Offset from Owner in the spawn position to avoid overlapping with the player character.

Validation Checklist

Before testing, verify:

✓
CompanionManager in scene
Exactly one instance, persistent across scenes
✓
CompanionOwnerAdapter on player
Or will be auto-added by Summon instruction
✓
CompanionDefinition has a prefab assigned
Prefab must have GC2 Character component
✓
FollowProfile is assigned
Either in Definition or as project default in Settings
✓
NavMesh baked in your scene
Companions use GC2 motion which requires NavMesh
✓
Summon instruction references correct Definition
SO reference comparison — no string matching
Debug Logging: Enable Debug Logging inWindow → Companion System → Settingsto see summon, recall, and state change events in the Console.