(One intermediate revision by one other user not shown)
Line 3:
Line 3:
|Name=Child Parent Audio Clip Player
|Name=Child Parent Audio Clip Player
}}
}}
{{stub}}
The '''ChildParentAudioClipPlayer''' component plays specified audio clips when it's immediate children are added to or removed from.
== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|ParentUnder|Slot|
|ParentUnder|Slot| Where to parent the slots to when playing sounds. (DON'T SET THIS TO THE SLOT THIS COMPONENT IS ON. else it will spam audio every game tick)
|MinDistance|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Float|Float]]>'''|TypeAdv1=true| The override for all [[Type:ClipData|ClipData]]s Min Distance when they are played.
|MaxDistance|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Float|Float]]>'''|TypeAdv2=true| The override for all [[Type:ClipData|ClipData]]s Max Distance when they are played.
|RolloffMode|'''[[Type:Nullable`1|Nullable`1]]<[[Type:AudioRolloffMode|AudioRolloffMode]]>'''|TypeAdv3=true| The override for all [[Type:ClipData|ClipData]]s Rolloff Mode when they are played.
|ParentedClips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv7=true| A list of audio clips to play when a slot is added to the immediate children of this component's slot.
|UnparentedClips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv8=true| A list of audio clips to play when a slot is removed from the immediate children of this component's slot.
}}
== PointMode ==
{{Table EnumValues
|ParentOrigin|0| Play the audio at the global position of this component's slot.
|ChildOrigin|1| Play the audio at the global position of the slot being added or removed.
|ParentBoundsCenter|2| Play the audio at the global center of the bounding box of this component's slot.
|ChildBoundsCenter|3| Play the audio at the global center of the bounding box of the slot being added or removed.