Automated: create new component page |
add info |
||
Line 3: | Line 3: | ||
|Name=Child Parent Audio Clip Player | |Name=Child Parent Audio Clip Player | ||
}} | }} | ||
The '''ChildParentAudioClipPlayer''' component plays specified audio clips when it's immediate children are added to or removed from. | |||
== | == 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| | |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| | |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| | |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. | ||
|PlayPointMode|'''[[#PointMode|PointMode]]'''|TypeAdv4=true| | |PlayPointMode|'''[[#PointMode|PointMode]]'''|TypeAdv4=true| Where to position audio clips when they are played. | ||
|ChildLimit|Int| | |ChildLimit|Int| If the immediate children count of this component's slot is above this amount, it will not play sounds. | ||
|FilterTag|String| | |FilterTag|String| If an added or removed immediate child has a tag that matches this value, a sound will not be played. | ||
|ParentedClips|{{RootFieldType|SyncList`1|[[Type:ClipData|ClipData]]}}|TypeAdv7=true| | |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| | |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. | |||
}} | }} | ||
== | == Usage == | ||
== Examples == | == Examples == | ||
== See Also == | == See Also == | ||
* [[Component:RandomAudioClipPlayer]] | |||
[[Category:Components:Media{{#translation:}}|Child Parent Audio Clip Player]] | [[Category:Components:Media{{#translation:}}|Child Parent Audio Clip Player]] | ||
[[Category:Components{{#translation:}}|Child Parent Audio Clip Player]] | [[Category:Components{{#translation:}}|Child Parent Audio Clip Player]] | ||
[[Category:Components With Nested Enums{{#translation:}}|Child Parent Audio Clip Player]] | [[Category:Components With Nested Enums{{#translation:}}|Child Parent Audio Clip Player]] | ||
Latest revision as of 19:21, 2 January 2025
Component image
The ChildParentAudioClipPlayer component plays specified audio clips when it's immediate children are added to or removed from.
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
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
|
Nullable`1<Float> | The override for all ClipDatas Min Distance when they are played. |
MaxDistance
|
Nullable`1<Float> | The override for all ClipDatas Max Distance when they are played. |
RolloffMode
|
Nullable`1<AudioRolloffMode> | The override for all ClipDatas Rolloff Mode when they are played. |
PlayPointMode
|
PointMode | Where to position audio clips when they are played. |
ChildLimit
|
Int | If the immediate children count of this component's slot is above this amount, it will not play sounds. |
FilterTag
|
String | If an added or removed immediate child has a tag that matches this value, a sound will not be played. |
ParentedClips
|
list of ClipData | A list of audio clips to play when a slot is added to the immediate children of this component's slot. |
UnparentedClips
|
list of ClipData | A list of audio clips to play when a slot is removed from the immediate children of this component's slot. |
PointMode
Name | Value | Description |
---|---|---|
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. |