# PlayAudio Script

**URL:** https://qa.fmod.com/t/playaudio-script/13093
**Category:** Unity
**Created:** [April 7, 2017, 8:07am UTC](https://qa.fmod.com/t/playaudio-script/13093 "2017-04-07T08:07:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mbmusicpl](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mbmusicpl](https://qa.fmod.com/u/mbmusicpl)
#### Post date: [April 7, 2017, 8:07am UTC](https://qa.fmod.com/t/playaudio-script/13093/1 "2017-04-07T08:07:26Z")

</div>

Hi,  
I am sound designer not programmer and i need Yor help. I am adding footsteps to 3rd person character.  
I made simple script in Java and put it into animation events as function. It works very well.

[[Album] Imgur ![](https://i.imgur.com/zhIxTTY.jpg?fb "Imgur") ](https://imgur.com/a/JDIPV)

**What i need is someone to help me with adding “random pitch function” to my script.**

Also is there a tut how to do it with FMOD? Viking Villiage shows only 1st person character

thanks

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [April 12, 2017, 6:48am UTC](https://qa.fmod.com/t/playaudio-script/13093/2 "2017-04-12T06:48:27Z")

</div>

> [@](#):
>
> Hi,  
> I am sound designer not programmer and i need Yor help. I am adding footsteps to 3rd person character.  
> I made simple script in Java and put it into animation events as function. It works very well.  
> [http://imgur.com/a/JDIPV](http://imgur.com/a/JDIPV)
> 
> **What i need is someone to help me with adding “random pitch function” to my script.**
> 
> Also is there a tut how to do it with FMOD? Viking Villiage shows only 1st person character
> 
> thanks

What do you mean by adding “random pitch function”.  
Are you using the pitch control in Studio at all?

---

<div class="post-metadata">

### Author: ![mbmusicpl](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mbmusicpl](https://qa.fmod.com/u/mbmusicpl)
#### Post date: [April 20, 2017, 5:30pm UTC](https://qa.fmod.com/t/playaudio-script/13093/3 "2017-04-20T17:30:06Z")

</div>

Hi  
I found answer, this is tut showing 3 person character animation events:

  
This function allows to use FMOD event in “Animation events”:

using System.Collections;  
using System.Collections.Generic;  
using UnityEngine;

public class Footsteps : MonoBehaviour {

```
// Use this for initialization
void PlaySound(string path)
	{
	FMODUnity.RuntimeManager.PlayOneShot(path, GetComponent<Transform> ().position);
	}

// Update is called once per frame
void Update () {
	
}

```

}
