Audio 3D
self:set_dimension
ClientSets the dimension of the audio-3d instance
Syntax
local status = self:set_dimension(
dimension
)Audio is only heard from the dimension it is in.
- Hearing — the client mutes the instance while its active camera is in a different dimension. Playback keeps running while muted, so the timeline stays in sync.
- Attached — an instance parented to another entity always follows its parent's dimension and cannot set its own, the call raises an error. Detaching it keeps the dimension it had.
Parameters
| Type | Name | Description |
|---|---|---|
int | dimension | Dimension id to apply Must be within 0 to 65535 |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_3d.create("sounds/ambient.ogg", true)
entity:set_dimension(1)