Skip to content

SpawnSoundAction ​

Inherits: EventAction < Resource

Spawns a sound in the world at a place: a bell from a tower, a growl from the dark, a campfire that crackles from now on. The place is a typed position, a marker of the world scene (a Marker3D or any 3D node, by name), an entity or an interactable (by unique id); a sound given a name can be stopped later with Stop Sound, and a sound that loops (with an optional pause between plays) stays until it is stopped. A sound that does not loop and has no name is played once and forgotten. See docs: Events > Audio actions.

Properties ​

SFXSelectionsfx_selection
PlaceplacePlace.POSITION
Vector3positionVector3.ZERO
Stringmarker_name""
intunique_id0
boolfollowfalse
boolloopfalse
floatdelay_min0.0
floatdelay_max0.0
Stringsound_name""

Methods ​

Stringget_function_description()
Node3Dresolve_place()

Enumerations ​

enum Place ​

Where the sound comes from

  • POSITION = 0
  • MARKER = 1
  • ENTITY = 2
  • INTERACTABLE = 3

Property descriptions ​

SFXSelection sfx_selection ​

Any sound effect (casting, impact, environmental, an interface sound ...): the sound with its volume, pitch and range

Place place = Place.POSITION ​

Where the sound comes from: a typed position, a marker of the world by its name, an entity or an interactable by its unique id

Vector3 position = Vector3.ZERO ​

The position (Position)

String marker_name = "" ​

The name of the marker node in the world scene (Marker)

int unique_id = 0 ​

The unique id of the entity or the interactable (Entity, Interactable)

bool follow = false ​

The sound goes with the entity or the interactable when it moves (Entity, Interactable)

bool loop = false ​

The sound plays again when it ends, until Stop Sound

float delay_min = 0.0 ​

The pause before a looping sound plays again, a random time between the two (seconds)

float delay_max = 0.0 ​

No description yet.

String sound_name = "" ​

The name of the sound, to stop it with Stop Sound. Spawning a sound with a name that is playing replaces it

Method descriptions ​

String get_function_description() ​

Return a description of this action with parameter placeholders (from EventAction)

Node3D resolve_place() ​

The node the place names (null for a position, or when nothing is found)