Skip to content

Looping Effects

Game Feel Flow supports looping effects for ambient animations such as breathing, heartbeat pulses, warning flashes, and idle wobbles.

Loop Settings

Every effect exposes three loop properties under the Looping group:

Property Description
loop_count Number of extra iterations. 0 = play once, -1 = loop forever until stop() is called.
loop_mode Repeat, PingPong or Mirror.
loop_delay Delay between iterations, in seconds.

Looping Foldout

Loop Modes

Repeat

Each iteration plays from the node's current state toward the target value.

Ideal for one-directional pulses that reset themselves inside a single iteration, such as an Elastic To Origin heartbeat.

var effect = GFFEffectCommon.new()
effect.target = GFFScaleTarget.new()
effect.target.target_value = Vector3(0.5, 0.5, 0.5)
effect.target.mode = GFFScaleTarget.Mode.BY_AMOUNT
effect.tweener = GFFElasticTweener.new()
effect.tweener.punch_mode = GFFElasticTweener.PunchMode.TO_ORIGIN
effect.duration = 0.4
effect.loop_count = -1
effect.loop_delay = 0.4

Repeat Loop

PingPong

The first iteration captures the start and end values, then alternates direction on every subsequent iteration. The value oscillates between two fixed points without drifting.

Ideal for breathing effects:

var effect = GFFEffectCommon.new()
effect.target = GFFScaleTarget.new()
effect.target.target_value = Vector3(0.25, 0.25, 0.25)
effect.target.mode = GFFScaleTarget.Mode.BY_AMOUNT
effect.tweener = GFFLinearTweener.new()
effect.duration = 1.5
effect.loop_count = -1
effect.loop_mode = GFFEffect.LoopMode.PING_PONG

PingPong Loop

Mirror

The tween direction stays the same, but the target parameters are reversed on odd iterations. For a relative offset this produces the same visual result as PingPong, while for absolute targets it mirrors the destination value.

effect.loop_mode = GFFEffect.LoopMode.MIRROR

Mirror Loop

Stopping Loops

An infinite loop (loop_count = -1) runs until the effect or its owner is stopped:

$GFFPlayer.stop()        # stop all effects on this player
GameFeelFlow.stop(target) # stop all GFF effects on a target node

Examples

See the loop demo scenes:

  • addons/game_feel_flow/examples/scenes/loops/loop_demo.tscn
  • addons/game_feel_flow/examples/scenes/loops/loop_breathing.tscn
  • addons/game_feel_flow/examples/scenes/loops/loop_heartbeat.tscn
  • addons/game_feel_flow/examples/scenes/loops/loop_warning.tscn