Skip to content

ASStateSnapshot

PT | EN
Inherits: Resource

Resource that captures and restores the state of an ASComponent.

Description

ASStateSnapshot is a high-level data container used for networking (replication, rollback) and gameplay persistence (save systems). It encapsulates all attribute base values, active tags, and the state of active effects (remaining time, stacks) of an [ASComponent] at an exact point in time (tick).

Properties

TypeNameDefault
Arrayactive_effects[]
Dictionaryattributes{}
Dictionary mapping attribute names (StringName) to their base values (float).
PackedStringArraytagsPackedStringArray()
List of all active tags at the time of capture.
inttick0
The simulation tick number when this snapshot was captured.

Methods

ReturnName
voidapply_to_component( component: ASComponent) const
Restores the state stored in this snapshot to the provided [ASComponent].
voidcapture_from_component( component: ASComponent)
Captures the current state (attributes and tags) from the provided [ASComponent] into this resource.