I am making a first person 3D game and adding footstep sound effects for when I am walking. Here is my declarations for the audioSource and audioClip:
public AudioClip footstepsSound;
public float timeBetween = 0.2f;
public AudioSource audioSource;
Then I use the the function AudioSoundsFX() to play the sound:
if(currentHorizontalSpeed > 0.001)
{
Invoke("AudioSoundsFX", 0.3f);
}
-note I use Invoke because I want to add a delay so my sounds aren’t overlapping everytime AudioSoundsFX is called-
Here is the AudioSoundsFX function:
private void AudioSoundsFX()
{
audioSource.Play(footstepSound);
}
I am getting the error cannot convert from ‘UnityEngine.AudioClip’ to ‘ulong’ for whatever reason even though I am pretty sure that I did everything correctly. My audio is in the AudioClip in the inspector and I have a speaker that plays the sound whenever AudioSoundsFX is called. I have no idea what is going on so any help would be appreciated.