Collision to change Pitch
This is a very brief script that is supposed to do a very simple thing. What's wrong with it?
using UnityEngine;
using System.Collections;
public class SoundManager : MonoBehaviour
{
public AudioSource Backgroundmusic;
void OnCollisionEnter(Collider other) {
if (other.tag == "Player") {
Backgroundmusic.pitch = 0.4f;
}
}
}
Comment