Random Audio Clip player is a component that is able to play a random audio file all the way through from a list of <code>Clips</code> and parent the resulting one shots under a slot.
The '''RandomAudioClipPlayer''' component is able to play a random audio file all the way through from a list of <code>Clips</code> and parent the resulting one shots under a slot.
<!--T:2-->
<!--T:2-->
Line 15:
Line 14:
|RolloffMode|'''[[Type:Nullable`1|Nullable`1]]<[[Type:AudioRolloffMode|AudioRolloffMode]]>'''|TypeAdv3=true| An optional [[Type:AudioRolloffMode|AudioRolloffMode]]
|RolloffMode|'''[[Type:Nullable`1|Nullable`1]]<[[Type:AudioRolloffMode|AudioRolloffMode]]>'''|TypeAdv3=true| An optional [[Type:AudioRolloffMode|AudioRolloffMode]]
|Clips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv4=true| The list of [[Type:ClipData|ClipData]] to choose from, randomly with weights.
|Clips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv4=true| The list of [[Type:ClipData|ClipData]] to choose from, randomly with weights.
}}
== Sync Delegates ==
{{Table ComponentTriggers
|Play:[[Type:Action|Action]]|[[Type:Action|Action]]|false| Plays a random audio clip at it's current position
|PlayAtPoint:[[Type:Action`1|Action`1]]<[[Type:Float3|Float3]]>|[[Type:Action`1|Action`1]]<[[Type:Float3|Float3]]>|false| Plays a random audio clip at the provided position.
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Attach to a slot and give the component some <code>Clips</code> to play. This component can be trigged via it's sync delegates or by [[Button Events|button events]]
Attach to a slot and give the component some <code>Clips</code> to play. This component can be trigged via it's [[Sync Delegate|sync delegates]] or by [[Button Events|button events]]
<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
This can be used for boopers, doorbells, or a bike horn.
This can be used for boopers, doorbells, or a bike horn.
Random Audio Clip Player component as seen in the Scene Inspector
The RandomAudioClipPlayer component is able to play a random audio file all the way through from a list of Clips and parent the resulting one shots under a slot.
the distance in meters in the audio's set transform space where the audio's perceived volume stops increasing and stays constant all the way to the center.