PlayAudio Script


(Maciej) #1

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.

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


(Cameron Baron) #2

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


(Maciej) #3

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 () {
	
}

}