# Play On Demand

## Introduction

{% hint style="info" %}
Part of the [Interaction Tools](/old-kb/toolkit-for-ui-and-ux/unity/learning/core-concepts/interaction-tools.md) of the UX Complete asset
{% endhint %}

A simple component that helps you hook any UnityAction, UnityEvent or other inspector feature up to a Play One Shot method.

The intent is that you use this tool to configure the source and clip to be played and then use standard Unity features or similar tools such as the Click event on a button or Bolt's ability to call methods to call the PlayOneShot method.

## Definition

### Fields and Attributes

| Type        | Name        | Notes                                 |
| ----------- | ----------- | ------------------------------------- |
| AudioSource | output      | used to play the sound                |
| AudioClip   | sound       | the sound to be played                |
| float       | volumeScale | the scale of the volume for this play |

### Funcitons

```csharp
public void PlayOneShot();
```

Plays the sound configured on the source configured at the volume scale configured.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.heathen.group/old-kb/toolkit-for-ui-and-ux/unity/components/play-on-demand.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
