1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wondering if anyone could help me with Unity 3D

Discussion in 'Entertainment and Technology' started by QWERTz, Apr 7, 2014.

  1. QWERTz

    QWERTz Guest

    I'm making a game which has a points system which is altered whenever the player picks up the coins. I have designed particle effects for the coins which i've turned into prefabs but the particles start when the game loads. this isn't what i need.

    Code:
    #pragma strict
    
    var coinparticles : Transform;
    
    function OnTriggerEnter (info : Collider)
    {
    	if (info.tag == "gPlayer")
    	{
    		Debug.Log("Add coin counter here!");
    		var effect = Instantiate(coinparticles, transform.position, transform.rotation);
    		Destroy(effect.gameObject, 3);
    		Destroy(gameObject);
    	}
    }
    "gPlayer" is one of the tags i'm using for characters.
    "coinParticles" is the name of the particle system.
    :help: