How to Instantiate a particle system at a certain prefab's position?

So i am working on a game where the player (ball) rolls through the level and collects coins. I want to add a vfx i made using the particle system at the the coins position when it is collected.How do i do that? The game is actually an endless runner type game and the levels are generated as the the player moves forward and each level is actually a pre-made prefab which has obstacles and coins. So how do i add effect on the coins position that was just collected?
Here is the code :

using UnityEngine;
using System.Collections;
using UnityEngine .UI ;

public class ScoreManager : MonoBehaviour {

private float score = 0.0f;
private int DifficultyLevel=1;
private int MaxDifficultyLevel = 20;
private int ScoreToNextLevel = 2;
public Text YourScoreText;

private bool IsInvincible ;

public Text ScoreText;

public Animator GameoverAnim;

public Renderer Ball;
public Material RedBall;
public Material YellowBall;

public GameObject coinfx;





// Use this for initialization
void Start () {

	IsInvincible = false;

}

// Update is called once per frame
void Update () 
{

	if (score >= ScoreToNextLevel && IsInvincible ==false)
		LevelUp ();
	score += Time.deltaTime;
	ScoreText.text = ((int)score).ToString (); 


}

void LevelUp()
{
	if (DifficultyLevel == MaxDifficultyLevel)
		return;
	ScoreToNextLevel *= 2;
	DifficultyLevel++;
	GetComponent <PlayerController > ().SetSpeed (DifficultyLevel );
}

void OnTriggerEnter(Collider trig)
{
    if (trig.gameObject.tag == "Obstacle" && IsInvincible == false)
    {

        //YouLoseCanvas.SetActive(true);

        //Time.timeScale = 0;

        StartCoroutine(gameover());

    }

    else if (trig.gameObject.tag == "InvincibleCoin")
    {

        StartCoroutine(InvincibilityActivate());
    }

    else if (trig.gameObject.tag == "Coin")
    {

        Instantiate(coinfx, );
    
        score = score + 5;
        ScoreText.text = ((int)score).ToString();
        Destroy(trig.gameObject);

    }

}

IEnumerator gameover()
{

	GameoverAnim.SetTrigger ("GameOver");

	YourScoreText.text = "You Scored : " +((int)score).ToString (); 

	if(PlayerPrefs .GetFloat ("Highscore") < score )
	PlayerPrefs.SetFloat ("Highscore", score);

	yield return new WaitForSeconds (1);

	Time.timeScale = 0;

	Debug.Log("GAME OVER !!");     
}

 IEnumerator InvincibilityActivate()
{

	IsInvincible = true;
    Ball.material = RedBall;

    GetComponent <PlayerController > ().SetSpeed (20 );

	yield return new WaitForSeconds (5);

    Ball.material = YellowBall;

	GetComponent <PlayerController > ().SetSpeed (DifficultyLevel );

    IsInvincible = false;

}
}

Instantiate(coinfx, trig.transform.position, Quaternion.identity) as GameObject;

The Scripting API is your friend :slight_smile:

Add to coin prefab a child gameobject called “CoinFX” that already has a component of ParticleSystem with setup effect.
Now - when you collect coin:
Play coin fx particles and do not destroy object for now (to not destroy fx), just turn off the renderer. Eventually you can destroy it after effect will end

trig.Find("CoinFX").GetComponent<ParticleSystem>().Play();     
(trig.GetComponent<Renderer>() as MonoBehaviour).enabled = false;