Possession
A bidirectional control framework where a Possessor (e.g., a Player) takes control of a Possessable (e.g., a Character). Both sides maintain event-driven hooks and configurable PossessAction callbacks, with spatial coupling handled via transform reparenting.
Architecture
Data Flow
Key Concepts
Possessor
The controlling entity (has a Possessor component + implements IPossessor)
Possessable
The controlled entity (has a Possessable component + implements IPossessable)
PossessAction
Abstract action hook — both sides have serialized possessAction / releaseAction fields for custom behavior
Spatial coupling
The possessable is parented under the possessor; LateUpdate keeps positions in sync
Multi-possession
A Possessor can possess multiple Possessable entities simultaneously
Extension methods
PossessorExtensions / PossessableExtensions bridge IPossessor/IPossessable interfaces to the underlying components
Quick Start
Making an entity possessable
Add a
Possessablecomponent to theGameObjectImplement
IPossessableon a sibling component (e.g.,Character)Optionally assign
PossessActionassets for custom possess/release behavior
Making an entity a possessor
Add a
Possessorcomponent to theGameObjectImplement
IPossessoron a sibling component (e.g.,Player)Call
possessor.Possess(possessable)to take control
Using extension methods
Classes
Component for entities that can possess — manages possession list and events
Component for entities that can be possessed — manages state and spatial coupling
See Also
Last updated