Skip to main content

Heatover

Based on game build 714014 | Last updated: 2026-03-08

Overview

HeatOver is a client-side UI widget that displays a dynamic heat distortion overlay (using a custom shader) over the screen when the owner's temperature exceeds safe thresholds. It integrates with the temperature component to track temperature changes, triggers level-based audio cues, and updates visual properties (alpha, distortion size, frequency, speed) to reflect the severity of overheating. It is typically attached to player entities and only visible on the client side.

Usage example

local inst = CreateEntity()
inst:AddTag("player")
inst:AddComponent("temperature")
-- HeatOver is usually instantiated internally by the player prefab
local heatover = inst:AddWidget("heatover")
heatover:OnHeatChange() -- Initial setup based on current temperature

Dependencies & tags

Components used: temperature, player_classified (fallback source for temperature) Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
ownerEntitynilThe entity whose temperature is monitored (typically a player).
imgImagenilThe visual image node displaying the heat overlay effect.
laststepnumber0Current heat level index (0–4), representing the threshold tier reached.
alpha_minnumber1.0Current minimum alpha value for the overlay; lerps toward alpha_min_target.
alpha_min_targetnumber1.0Target minimum alpha, determined by heat level.
effectTimenumber0.0Accumulated time used by the shader for animation progression.
effectSizenumber0.0Current distortion size parameter; lerps toward effectSize_target.
effectSize_targetnumber0.0Target distortion size, based on heat level.
effectFrequencynumber0.0Current distortion frequency parameter; lerps toward effectFrequency_target.
effectFrequency_targetnumber0.0Target distortion frequency, based on heat level.
effectSpeednumber0.0Distortion speed parameter (currently fixed per level, not lerped).

Main functions

OnHeatChange()

  • Description: Reads the owner's current temperature, determines the active heat level (0–4), and updates visual/audio properties accordingly. Resets or updates targets for alpha, distortion size, frequency, and speed.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Falls back to TUNING.STARTING_TEMP if temperature and player_classified components are unavailable.

OnUpdate(dt)

  • Description: Called during every frame while the overlay is visible. Lerp alpha_min, effectSize, and effectFrequency toward their targets, and update shader parameters. Hides the overlay and stops updates when alpha_min >= 0.99 (i.e., near ambient/non-heated state).
  • Parameters: dt (number) – Delta time in seconds since the last frame.
  • Returns: Nothing.

Events & listeners

  • Listens to: temperaturedelta (on owner) – triggers OnHeatChange() when temperature changes.