SetSound3DMinMaxDistance

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

setSound3DMinMaxDistance

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.

Changes the attenuation distances of a positional sound owned by the current client resource.

Syntax

bool setSound3DMinMaxDistance(number sound, number minDistance, number maxDistance)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.
minDistance number yes Full-volume distance in metres, at least 0.01.
maxDistance number yes Maximum attenuation distance in metres, greater than minDistance and no greater than 10,000.

Returns

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

Examples

Extend the range of an ambient source:

setSound3DMinMaxDistance(ambientSound, 3.0, 90.0)

Notes

  • Available only in client-side resource scripts.
  • This function returns false for sounds created by playSound.