gameObject.SetActive(false); not working as intended

So I am trying to make my coins disappear.


IEnumerator waitOneSecond(GameObject targetDisable)
		yield return new WaitForSeconds (1f); //wait 1 second
		targetDisable.SetActive (false); //disables coin particles
		theTimeCounter.DestroyCoin (); //destroy coin (event in another script)


public class TimeCounter : MonoBehaviour {
	public void DestroyCoin () {
		gameObject.SetActive (false);
		Debug.Log ("destroyd");

The Debug.Log message is shown which means it ‘works’ but gameObject is still shown.

Both of the scripts belong to a prefab coin (as shown in the badly cropped image below)

Any solutions to why it won’t disappear and how to make it disappear itself? ~Thanks

Is there another script enabling coin? Please checkout. Your code looks fine. It should disable gameObject.

I may be wrong but I don’t see anything passed to the destroy coin function.
It may have been passed some other way but unless it has what is it destroying if it hasn’t been passed something?

I have the same problem. Trying to disable a gameobject with gameObject.SetActive(false); but to no avail. Not accessing it from any other script either.