Skip to content

Get Sansar

Script API

PlaySettings

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Struct Namespace Sansar.Simulation

The PlaySettings class contains settings for playing sounds.

public struct PlaySettings

Remarks

See AudioComponent.PlaySoundOnComponent and AgentPrivate.PlaySound

Members at a glance

KindMembers
FieldsDontSync · Looped · Looping · Loudness · Offset · PitchShift · PlayOnce

Fields

DontSync

public bool DontSync

false = we adjust the offset per Agent so that the sound is synchronized to everyone. This means late-joining Agents will hear sound at a greater offset. true = turn this off, let everyone hear sound from start / your offset

Remarks

The default value is false.

Looped

public static readonly PlaySettings Looped

The default play parameters for looped sounds.

Looping

public bool Looping

false = play once, true = sound will loop.

Remarks

The default value is false.

Loudness

public float Loudness

Loudness in dB.

Remarks

Default is 0.

Offset

public float Offset

Play from time offset (in seconds). Use DontSync if you want everyone to hear the sound from this offset regardless of when they join.

Remarks

The default is 0.

PitchShift

public float PitchShift

Relative pitch, in semitones. Changing a sound’s pitch also affects its duration. For example, if you raise the pitch by 12 semitones (an octave), it plays twice as quickly.

Remarks

The default is 0.

PlayOnce

public static readonly PlaySettings PlayOnce

The default play parameters for sounds that play once.

Used in examples

Generated from the Sansar 47.10.0 client ScriptApi snapshot.