Short Audio on Collision only playing sometimes

Hey guys, I’m having trouble trying to get my audio to play every time my player collides with a block. Its about a 50/50 chance, which I found is weird.

I tried all the solutions that I looked for online, but have yet to find one to help me.

What I tried:

Lowering my fixed time stamp

Changing my player and block collision detection to continuous

My Script for the collision:
public AudioSource collisionSound;

    void OnTriggerEnter2D(Collider2D col)

        Color myColor = GetComponent<Renderer>().material.color;
        Color otherColor = col.gameObject.GetComponent<Renderer>().material.color;
        if (myColor.Equals(otherColor))
    {
            collisionSound.Play();
            effect.Play();
    }

Thanks!

I actually figured it out! I Debug.Logged it and the code itself wasn’t firing so I moved it to my point system and it works :slight_smile:

Thank you for your time though!