Riferimento API di nanos world Documentazione italiana non ufficiale
Documentazione ufficiale
Costruttore Condiviso

Sound.Default Constructor

Sintassi

Lua
Sound(location, asset, is_2D_sound = false, auto_destroy = true, sound_type = SoundType.SFX, volume = 1, pitch = 1, inner_radius = 400, falloff_distance = 3600, attenuation_function = Linear, keep_playing_when_silent = false, loop_mode = Default, auto_play = true)

Parametri

Nome Tipo Predefinito Descrizione
location Vector Only used if 3D sound
asset SoundPath The Sound Asset to load
is_2D_sound facoltativo boolean false Whether to spawn it as 2D or 3D
auto_destroy facoltativo boolean true Whether to destroy after finished playing
sound_type facoltativo SoundType SoundType.SFX Used to apply user's volume settings
volume facoltativo float 1
pitch facoltativo float 1
inner_radius facoltativo float 400 Only used if 3D sound
falloff_distance facoltativo float 3600 Only used if 3D sound
attenuation_function facoltativo AttenuationFunction Linear Only used if 3D sound
keep_playing_when_silent facoltativo boolean false Only used if 3D sound - Use with caution, it may cause performance issues!
loop_mode facoltativo SoundLoopMode Default Whether should force sound to loop
auto_play facoltativo boolean true If should should immediately play when loaded