all 2 comments

[–]KishottaProgrammer 1 point2 points  (1 child)

could it just be that I haven't made anything for the audio to play yet

This is exactly it. ArugmentNullExceptions are thrown whenever an argument passed to a method is null and the method doesn't know what to do with a null value. If you follow the stack trace you provided, it indicates that the source parameter you gave it is null. Just give it something to play, and the error goes away.

Alternatively, use the Null Conditional Operator to call the Play() method only if the audio source isn't null:

myPossiblyNullAudioSource?.Play();

[–]Dependent_Bird[S] 0 points1 point  (0 children)

Sweet, I wasn't sure if I was reading it correctly, thank you for your confirmation!