Hi Everyone,
I know this sounds weird, but I’m not sure if it’s something I’m doing wrong.
I need an object to start emitting sound after certain Event and also trigger an Animation so:
[SerializeField]
private Animator myAnim;
[SerializeField]
private AudioSource sound;
void Start()
{
myAnim = GetComponent<Animator>();
sound = this.GetComponent<AudioSource> ();
}
public void PowerConveyorBelt()
{
sound.Play ();
myAnim.SetBool("IsON", true);
}
This simple script is not working. If I check the Play on Awake in the AudioSource component, the sound plays nice and smooth…
Is there another method to do this? Does the Animator interfere with the AudioSource?
I kind of listen to noise and interference when they Play through the scritp. Is there a Parameter I should be touching?
Thanks everyone in advance.
I forgot. For this specific project I’m using a very old version of Unity (5.2)