First, add a Print or Debug.Log message in the collision check to make sure the collision is being detected.
And post your script using code tags – if it’s not working, I don’t think we can assume the script is good (it might be, but still).
A shot in the dark: make sure you used OnTriggerEnter2D() and not OnTriggerEnter2d().