NEOLearn

ECS examples

The engine's ECS examples: what each one shows, whether it runs in a browser and the command that runs it.

Updated October 20, 2026

On this page

Entities, components, systems, queries, change detection, messages, observers, hooks, relationships and schedules. There are 35 examples on this page. For the concepts behind them, see ECS.

Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.

Examples#

ExampleWhat it showsWebRun
CallbacksStore arbitrary systems in components and run them on demandYescargo run --example callbacks
Change DetectionChange detection on components and resourcesNocargo run --example change_detection --features track_location
Component HooksDefine component hooks to manage component lifecycle eventsNocargo run --example component_hooks
Contiguous QueryDemonstrates contiguous queriesNocargo run --example contiguous_query
Custom ExecutorDemonstrates how to make a custom SystemExecutorNocargo run --example custom_executor
Custom Query ParametersGroups commonly used compound queries and query filters into a single typeNocargo run --example custom_query_param
Custom ScheduleDemonstrates how to add custom schedulesNocargo run --example custom_schedule
Delayed CommandsDemonstrates how to schedule ECS commands with a delayYescargo run --example delayed_commands
Dynamic ECSDynamically create components, spawn entities with those components and query those componentsNocargo run --example dynamic --features debug
ECS GuideFull guide to NEO's ECSNocargo run --example ecs_guide
Entity disablingDemonstrates how to hide entities from the ECS without deleting themYescargo run --example entity_disabling
Error handlingHow to return and handle errors across the ECSNocargo run --example error_handling --features mesh_picking
ExtractionDemonstrates different ways of extracting components, copying them from the main world to the render worldNocargo run --example extraction
Fallible System ParametersSystems are skipped if their parameters cannot be acquiredNocargo run --example fallible_params
Fixed TimestepShows how to create systems that run every fixed timestep, rather than every tickNocargo run --example fixed_timestep
Generic SystemShows how to create systems that can be reused with different typesNocargo run --example generic_system
HierarchyCreates a hierarchy of parents and children entitiesNocargo run --example hierarchy
Hotpatching SystemsDemonstrates how to hotpatch systemsNocargo run --example hotpatching_systems --features hotpatching
Immutable ComponentsDemonstrates the creation and utility of immutable componentsNocargo run --example immutable_components
Iter CombinationsShows how to iterate over combinations of query resultsYescargo run --example iter_combinations
MessageIllustrates message creation, activation, and receptionNocargo run --example message
Nondeterministic System OrderSystems run in parallel, but their order isn't always deterministic. Here's how to detect and fix this.Nocargo run --example nondeterministic_system_order
Observer PropagationDemonstrates event propagation with observersYescargo run --example observer_propagation
ObserversDemonstrates observers that react to events (both built-in life-cycle events and custom events)Yescargo run --example observers
One Shot SystemsShows how to flexibly run systems without scheduling themNocargo run --example one_shot_systems
Parallel QueryIllustrates parallel queries with ParallelIteratorNocargo run --example parallel_query
RelationshipsDefine and work with custom relationships between entitiesNocargo run --example relationships
Removal DetectionQuery for entities that had a specific component removed earlier in the current frameNocargo run --example removal_detection
Run ConditionsRun systems only when one or multiple conditions are metNocargo run --example run_conditions
Startup SystemDemonstrates a startup system (one that runs once when the app starts up)Nocargo run --example startup_system
State ScopedShows how to spawn entities that are automatically despawned either when entering or exiting specific game states.Nocargo run --example state_scoped
System ClosureShow how to use closures as systems, and how to configure Local variables by capturing external stateNocargo run --example system_closure
System ParameterIllustrates creating custom system parameters with SystemParamNocargo run --example system_param
System PipingPipe the output of one system into a second, allowing you to handle any errors gracefullyNocargo run --example system_piping
System SteppingDemonstrate stepping through systems in order of execution.Nocargo run --example system_stepping --features neo_debug_stepping

See also#