playoneshot doesnt work

hello

whenenever i do audiosource playoneshot it doesnt work.

i have it like this:

if(death == true)
{
playoneshot(dead);
destroy this gameobject
}

note: code was typed on mobile to not that good.

but for some reason it won’t play the dead sound.

hope someone can help

How about posting your actual code from your computer instead of posting some pseudocode from mobile? We can’t debug that.

Quick thought, if you destroy the gameobject right after trying to play oneshot, it wont play at all because its not there anymore.