public AudioClip fireSound;
Declared on top, I haven’t dragged the thing yet, but I will as soon as error goes away.
In middle of Update, after an correct if and all the checked statements that work perfectly.
GetComponent<AudioSource>().Play(fireSound);
Producing errors:
Assets/Scripts/FireBullet.cs(25,53): error CS1502: The best overloaded method match for UnityEngine.AudioSource.Play(ulong)' has some invalid arguments** and **Assets/Scripts/FireBullet.cs(25,53): error CS1503: Argument
#1’ cannot convert UnityEngine.AudioClip' expression to type
ulong’
Then tried
audio.GetComponent<AudioSource>().Play(fireSound);
Assets/Scripts/FireBullet.cs(25,25): error CS0619: UnityEngine.Component.audio' is obsolete:
Property audio has been deprecated. Use GetComponent() instead. (UnityUpgradable)’
Assets/Scripts/FireBullet.cs(25,59): error CS1502: The best overloaded method match for `UnityEngine.AudioSource.Play(ulong)’ has some invalid arguments
and
Assets/Scripts/FireBullet.cs(25,25): error CS0619: UnityEngine.Component.audio' is obsolete:
Property audio has been deprecated. Use GetComponent() instead. (UnityUpgradable)’
Any help requested please.