Sound will not play in an if statement.

The sound plays fine on awake and in the update loop , however when I try to play it on a collision it will not work.

instruc9er is right, How can I pause for the length of the sound before destroying the object?

The collision is working, I don’t know how to wait for the sound to finish then destroy the object.

void OnCollisionEnter(Collision collision) {
    		if (collision.gameObject == player) {
    		pickup.Play();
    			switch(type) {
    			
    			case 0:
    				playerprop.health += 10;
    				break;
    			case 1:
    				break;
    			}
    			
    			Object.Destroy(gameObject);
    		}

Try this instead:

if (collision.gameObject.name == player.name) {
}