Game Maker

Player Start/Stop Sprinting

Triggers actions when a player starts or stops sprinting.

These two events allow you to create logic based on a player's sprinting state.

Player Start Sprinting

Triggers the moment a player begins sprinting.

  • Action Values: Player
  • Use Cases:
    • Consuming a custom "stamina" property while a player sprints.
    • Applying a temporary speed boost at the start of a sprint.
    • Playing a "charge" sound effect when a player starts to run.

Player Stop Sprinting

Triggers when a player stops sprinting (either by releasing the key or running out of hunger).

  • Action Values: Player
  • Use Cases:
    • Stopping the consumption of a "stamina" property.
    • Applying a temporary slowness effect after a long sprint to simulate exhaustion.
    • Starting stamina regeneration.

Example: A Stamina System

  1. Properties:
    • Player Number property Stamina, default 100.
    • Player Boolean property isTired, default false.
  2. Start Sprint Event:
    • In a Player Start Sprinting event, add a Conditional action that checks if isTired is false.
    • If Actions: Start a While Loop (repeating every 20 ticks) that continues as long as the player is sprinting and their Stamina > 0.
      • Inside the loop, Subtract 5 from the player's Stamina property.
  3. Stop Sprint Event:
    • In a Player Stop Sprinting event, you can add logic to start regenerating stamina over time using another timed function.