Stride script lifecycle
Chooses synchronous or asynchronous scripts according to when work runs or waits. It makes ordering and cancellation explicit so destroyed entities do not receive delayed actions or block the game loop.
stride-scripts-lifecycle
See how it helpsWhen is it useful?
Use when entity removal leaves background work or duplicated handlers in Stride.
What does it help you do?
- Chooses script type from when work executes or waits.
- Pairs subscriptions and awaited work with entity cancellation.
- Avoids dependence on unspecified equal-priority ordering or blocking the game loop.
Try asking this
Our quest NPC starts a delayed conversation and waits for an animation. Leave the scene before the wait ends, then return. Cancel work owned by the old NPC, remove its subscriptions and define the required order so no ghost dialog appears and the main loop keeps running.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
Stride — scripts lifecycle
Use when implementing Stride startup, synchronous or asynchronous scripts and entity teardown.
Version and project gate
Inspect Solution/project packages, exact Stride version, Game Studio/editor environment, asset and prefab files, Startup/Sync/AsyncScript usage, physics packages/backends, graphics profile and target platform. Do not assume every editor or physics feature exists on every host. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Choose the script type from when work should run or await. Define Start/Update/Execute/Cancel ownership according to the installed API. Pair subscriptions and asynchronous work with cancellation when the entity leaves the scene. Do not rely on equal-priority execution order.
Deliver
A script lifecycle/ordering map and focused implementation with repeatable cleanup. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
AsyncScript is scheduled game work, not permission to block the main loop or ignore entity cancellation.
Acceptance scenario
Remove and re-add the entity, cancel during an await and unload the scene without duplicated handlers or late state writes. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Strider. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Included files 1
SKILL.md
