ecspresso
    Preparing search index...
    • Directly transition an entity's state machine to a target state. Fires onExit, onEnter hooks and publishes stateTransition event.

      Parameters

      • ecs: StateMachineWorld

        ECS instance (structural typing)

      • entityId: number

        Entity to transition

      • targetState: string

        State to transition to

      Returns boolean

      true if transition succeeded, false if entity has no stateMachine or target state doesn't exist