Audio spot volume based on distance
do you have an example blocks code snippet where you can get the audio of a spot off and on relative to the distance to that audio spot?
0
-
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.
Comments
1 comment