SetSound3DPosition

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setSound3DPosition

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Moves a positional sound owned by the current client resource.

Syntax

bool setSound3DPosition(number sound, number x, number y, number z)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.
x number yes World X coordinate in metres.
y number yes World Y coordinate in metres.
z number yes World Z coordinate in metres.

Returns

Returns true when an owned 3D sound is moved; otherwise returns false.

Examples

Move a sound with a scripted world object:

setSound3DPosition(forge, x, y, z)

Notes

  • Available only in client-side resource scripts.
  • This function returns false for sounds created by playSound.
  • Coordinates use metres, must be finite, and are limited to +/-1,000,000 metres per axis.