Create a stateMachine component from a definition.
The state machine definition to use
Optional
Optional overrides (e.g., initial state)
Component object suitable for spreading into spawn()
ecs.spawn({ ...createStateMachine(enemyFSM), position: { x: 100, y: 200 },}); Copy
ecs.spawn({ ...createStateMachine(enemyFSM), position: { x: 100, y: 200 },});
Create a stateMachine component from a definition.