Curitor
The Player · Topic Guide

Character

One player prefab powers single-player, split-screen and online. This guide walks its component stack, the movement modes, how to drive it from code, and how it comes back after falling off your level.

Overview

The character is deliberately one prefab. Instead of maintaining an offline player, a couch-co-op player and a networked player, every mode-specific component on the prefab wakes up only when its mode is active — offline, the networking components stay dormant; online, remote copies keep their input and camera off. You tune one object, and it behaves correctly everywhere. A single level that wants its own attack, stats or components does not have to touch this shared prefab at all — see One prefab, or one per level on the Game Modes page.

The component stack

Selecting the player prefab shows a tall Inspector — every entry has one job. Grouped by module:

FieldTypeWhat it does
Rigidbody + CapsuleColliderUnityThe character is physics-driven — movement forces act on the body, animation stays visual-only.
PlayerInputUnity Input SystemDevice pairing and input actions. Ships disabled on the prefab — see the callout below.
PartyCharacterMovementThe movement brain: owns the active movement mode, ground/water/wall sensing and the public input API.
NetworkObject + ClientNetworkTransform + OwnerNetworkAnimatorNetcodeOwner-authoritative position and animation replication. Dormant outside online sessions.
NetworkPlayerControllerNetcodeDecides who controls this instance: enables input, camera and movement for the owner, keeps remote proxies passive.
CharacterStats + StatReplicatorStatsHealth, stamina and level from stat definition assets; the replicator mirrors values to other machines.
CharacterInventory + CharacterEquipment + InventoryReplicatorInventoryCarried stacks, worn gear with stat bonuses, and their network mirror.
PlayerInteractorScriptingFinds nearby interactables and drives their prompts — press, hold or multi-press.
PlayerRespawnerRoundsDeath and fall recovery with checkpoints — detailed below.
The player prefab's Inspector showing the full component stack
The player prefab in the Inspector — the stack above, top to bottom.

Movement modes

Movement is a set of self-contained modes behind one interface — the active mode owns the physics until it hands over. All tuning lives in a single MovementConfig asset, so balancing a feel change is one file, not a component hunt.

On the ground

Walk & SprintCrouchSlide

In the water

Swim

Sprinting drains stamina and resting refills it (the hook into Stats & Effects), and every mode maps to an animator contract your own rig can implement.

Driving the character from code

Player devices reach the character through Unity's input callbacks, but those callbacks just forward to public methods — and your code can call the same methods. That keeps the low-code promise intact: the toolkit's own UI, instructions and future AI all steer characters through this one front door.

AutoRunner.cs
using Curitor.PartyCoreKit.Character;
using UnityEngine;

// Anything can drive a character through the same public API the
// input callbacks use -- UI buttons, cutscenes, AI, tutorials.
public class AutoRunner : MonoBehaviour
{
    [SerializeField] private PartyCharacter character;

    private void Update()
    {
        character.SetMoveInput(Vector2.up);  // clamped to length 1
        character.SetSprint(true);           // drains stamina while moving

        if (character.IsGrounded)
            character.RequestJump();         // consumed on the next physics tick
    }
}

The full surface includes SetMoveInput, RequestJump, SetJumpHeld, SetSprint and SetCrouch, plus read-only state like IsGrounded, InWater and IsSprinting for your own conditions.

Respawning: PlayerRespawner

The last component on the stack answers an unglamorous but essential question: what happens when a player dies or falls off the map? The respawner waits a beat, returns the character to its last checkpoint (or a spawn point if none is set), and optionally refills its stats.

FieldTypeDefaultWhat it does
Respawn Delay Secondsfloat1.5Pause between dying (or falling) and reappearing at the checkpoint.
Kill Below Yfloat-15Falling below this world height counts as a fail and triggers a respawn — the safety net under every level.
Restore StatsboolonRefill vitals on respawn, so players return ready instead of crawling back on low health.

Checkpoints usually come from the stock SetCheckpointInstructioncomposed onto a trigger zone — no code needed. From code, it's two methods: SetCheckpoint(position, rotation) and RequestRespawn().

CheckpointOnEnter.cs
using Curitor.PartyCoreKit.Rounds;
using UnityEngine;

// Set a checkpoint from your own code (the stock
// SetCheckpointInstruction does exactly this).
public class CheckpointOnEnter : MonoBehaviour
{
    private void OnTriggerEnter(Collider other)
    {
        var respawner = other.GetComponentInParent<PlayerRespawner>();
        if (respawner == null || !respawner.IsLocallyControlled) return;

        respawner.SetCheckpoint(transform.position, transform.rotation);
    }
}