How to Destroy clone gameobjects?

Hi, i have a coin which has an animation and an effect
so after the coin is picked up, the the game object coin will be destroyed and so will the clone after 3 seconds
but i get this error
“Can’t destroy Transform component of ‘Coin_Effect(Clone)’. If you want to destroy the game object, please call ‘Destroy’ on the game object instead. Destroying the transform component is not allowed.”

How to remove this error?
Here is the code

using UnityEngine;
using System.Collections;

public class CoinPickup : MonoBehaviour
{

public Transform coinEffect;

// Update is called once per frame
void OnTriggerEnter (Collider info)
{
if (info.tag == “Player”)
{
Object effect =Instantiate(coinEffect,transform.position,transform.rotation);
Destroy(effect,3);
Destroy(gameObject);
}
}
}

When you call Instantiate on coinEffect, which is a transform, it clones that transform and the game object attached to it but returns the new transform. So you can either change “public Transform coinEffect” to “public GameObject coinEffect”, or change “Destroy(effect, 3)” to “Destroy effect.gameObject, 3)”

Hey, When i changed public Transform coinEffect" to "public GameObject coinEffect, It Worked!!!:slight_smile:
Thanks for your help makeshiftwings!!!