Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

particles won't play when using particlesystem.play () ?

Discussion in 'Scripting' started by clearrose, Jan 20, 2016.

  1. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349
    Hello all, I have a revive particle thats suppose to play when my player enters the trigger for with the tag "coin". however, the particles fails to play.

    the debug logs do go to the console and one was testing to see if the revive particle was playing and it keeps returning false.

    Screen Shot 2016-01-20 at 4.41.19 PM.png

    Code (CSharp):
    1.  public void OnTriggerEnter2D(Collider2D other)
    2.     {
    3.         //If the submarine is collided with a coin
    4.         if (other.tag == "Coin")
    5.         {
    6.             scoreValue = 1;
    7.  
    8.             //Notify the level manager, and disable the coin's renderer and collider
    9.             levelManager.CoinCollected (other.transform.position);
    10.             other.GetComponent<Renderer> ().enabled = false;
    11.             other.GetComponent<Collider2D> ().enabled = false;
    12.             coinScript.AddScore (scoreValue);
    13.  
    14.             AudioManager.Instance.PlayCoinCollected ();
    15.  
    16.             else if (other.name == "Hidden Heart Squishy")
    17.             {
    18.                 if (!reviveParticle.isPlaying)
    19.                 {
    20.                     reviveParticle.Play ();
    21.                     Debug.Log ("Is revive particles playing = " + reviveParticle.isPlaying);
    22.                 }
    23.  
    24.                 SaveManager.revive += 1;
    25.  
    26.                 Debug.Log ("Hidden Heart Squishy +1 Revive; Number of Revives = " + SaveManager.revive);
    27.             }
    28.         }
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    *points to the bright red errors in the console* probably has something to do with those... no?

    Invalid AABB might indicate you've got a divide by zero going on somewhere in your particle setup
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,795
    This is a known bug that will be fixed in next weeks patch.
     
  4. clearrose

    clearrose

    Joined:
    Oct 24, 2012
    Posts:
    349

    Thanks at least i know what's going on, This was driving me crazy.