Strata - v1.4.10
    Preparing search index...

    Function createCombatMachine

    • Creates a combat animation machine with attack and damage states.

      Parameters

      • animations: Partial<Record<"idle" | "attack" | "hit" | "death" | "dodge" | "block", string>>

        Map of combat state names to animation clips

      Returns StateMachine<
          {
              blendFactor: number;
              currentAnimation: string;
              isPaused: boolean;
              metadata?: Record<string, unknown>;
              playbackSpeed: number;
              previousAnimation: string | null;
              timeInState: number;
          },
          AnyEventObject,
          Record<string, AnyActorRef>,
          ProvidedActor,
          ParameterizedObject,
          ParameterizedObject,
          string,
          StateValue,
          string,
          unknown,
          NonReducibleUnknown,
          EventObject,
          MetaObject,
          any,
      >

      Configured animation machine for combat

      const combat = createCombatMachine({
      idle: 'Combat_Idle',
      attack: 'Attack_Slash',
      hit: 'Take_Damage',
      death: 'Death'
      });