Skip to main content

Audio spot volume based on distance

Comments

1 comment

  • Rens | Moderator

    Hello,

    Thank you for using Fectar with Fectar Blocks to create your content.

    var d = vector3.distance(Space.Camera.Position, posB)
    spot.audio.volume = Math.Clamp01(d/100)

    where posB is the position of the object you want the audio relative to and spot.audio is de spot that contains the audio track.

    1

Please sign in to leave a comment.