Built-in Components
Quick references for the most commonly used PurrDiction components you can drop into scenes.
PredictedTransform
Purpose: Predicts and reconciles position/rotation; renders a smoothed view.
Works with: bare
Transform,Rigidbody,Rigidbody2D, and optionallyCharacterController.Key fields:
Graphics: Optional child transform to move for visuals only.
Unparent Graphics: Avoid disable/enable artifacts on reconcile by unparenting.
Character Controller Patch: Temporarily disable the controller when applying rollback state.
Interpolation Settings: Assign a
TransformInterpolationSettingsasset; a default asset ships atAssets/PurrDiction/Runtime/Transform/DefaultInterpolation.asset.Float Accuracy:
Purrfect(full),Medium(compressed),Low(half) network packing for state.
PredictedRigidbody (3D)
Purpose: Predicts
Rigidbodymotion with deterministic simulation and reconciles state.Requirements: Enable 3D physics in
PredictionManagerviaBuiltInSystems.Physics3Dand select a physics provider that includes Unity 3D physics.Notes:
PurrDiction switches Unity to script-driven simulation for ticks; avoid using
FixedUpdatefor physics.For callbacks, see
IPredictedPhysicsCallbacksandPredictedPhysicsCallbacksin the UnityPhysics runtime folder.
PredictedRigidbody2D (2D)
Purpose: Predicts
Rigidbody2Dmotion similarly to 3D.Requirements: Enable 2D physics in
PredictionManagerviaBuiltInSystems.Physics2Dand include the Unity 2D physics provider.
PredictedIdentitySpawner
Purpose: Spawns a set of
NetworkIdentityobjects deterministically from prediction.Usage:
Add component, list identities to spawn.
On server, spawns and assigns observers/ownership.
On clients, mirrors spawns during verified replays.
Caveat: Marked
[PredictionUnsafe]because it orchestrates networked side‑effects; keep core simulation deterministic.See: Predicted Hierarchy docs for details.
Prebuilt Samples
Located under
Assets/PurrDiction/Runtime/Prebuilt/.Examples:
TopDownMovement_CC,TopDownMovement_RB,RigidbodyShooter,RigidbodyKnockback,RigidbodyJump.Intended as reference implementations; adapt logic to your project’s states/inputs.
Related Systems
PredictedStateMachine: Modular state logic with view hooks. See the State Machine docs.PredictedRandom: Deterministic RNG for predicted code paths.PredictedPlayers,PredictedTime,PredictedHierarchy: Built‑ins registered byPredictionManagerto support common gameplay needs.
Last updated