Skip to content

Lifecycle

Overview

This section covers the Lifecycle methods that manage existing Fracture Pieces after they've been created.

All Lifecycle methods apply to all existing Pieces.

Methods

.Clear()

Fracture.Clear()Struct.Fracture

Destroys all existing Fracture Pieces immediately.

Use it to wipe debris whenever you need a clean slate.


.ForceFade()

Fracture.ForceFade()Struct.Fracture

Begins fading out all existing Fracture Pieces immediately.

Use it for a soft clear that lets debris fade out gradually instead of instantly vanishing.

TIP

Pieces with a fade speed of 0 are not affected, since they have no fade rate to apply. Set fade speed via .Fade().


.Pause()

Fracture.Pause()Struct.Fracture

Pauses fade processing on all existing Fracture Pieces.

This only halts fading. It does not pause the physics world itself, so Pieces keep moving. Pair it with physics_pause_enable(true) to completely freeze Pieces in place.

js
// A function for pausing the game
function PauseGame() {
	global.paused = true;

	physics_pause_enable(true);
	Fracture.Pause(); 
	audio_pause_all();

	// Other pausing logic...
}

.Resume()

Fracture.Resume()Struct.Fracture

Resumes fade processing on all paused Fracture Pieces.

Pair it with physics_pause_enable(false) to resume the physics simulation alongside fading.

js
// A function for resuming the game
function ResumeGame() {
	global.paused = false;

	physics_pause_enable(false);
	Fracture.Resume(); 
	audio_resume_all();

	// Other resuming logic...
}