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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to know the position of a particle when it stops moving

Discussion in '2D' started by Gonzasmpl, Dec 6, 2019.

  1. Gonzasmpl

    Gonzasmpl

    Joined:
    Jul 30, 2018
    Posts:
    55
    Hi, I'm trying to make a persistant particle system using meshes. The point is that animating particles through code is not easy for me, so I would like to use the particle system from unity, but that's not quite performant in my project due to the amount of particles being draw. I hardly never work with the particle system so I'm not familiar with it.

    What I would like to know is if there is some way to get the position and rotation of every particle when it stops moving. Knowing that, I can "add it to a mesh" and then destroy the particle system.

    Any suggestion or advice is appreciated, thanks!
     
  2. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Particles do, in fact, have a collider system with the sub emitters. You can add a sub emitter and place your colliders to capture the particles as they hit and obtain that data.
     
  3. Gonzasmpl

    Gonzasmpl

    Joined:
    Jul 30, 2018
    Posts:
    55
    You're right, I don't know why it doesn't come to mind. I think it would do the trick, Thanks.
     
    MisterSkitz likes this.
  4. motivision

    motivision

    Joined:
    Dec 3, 2019
    Posts:
    28
    honestly I work with particles through SetActive

    that`s small example from my simple game which I create and teach

    Code (CSharp):
    1. //particle effect ornage morkovka
    2.     public GameObject fruitboxpe;
    3.  
    4.     //particle effect red morkovka
    5.     public GameObject fruitpe2;
    6.  
    7.     //gribs particle effects
    8.     public GameObject gribseffectactivate;
    9.  
    10.     //gribs deactivate particle effects
    11.     public GameObject gribsdeactivateeffect;
    12.  
    13.     public AudioSource fruitground;
    14.     public AudioSource pointscore;
    15.  
    16.     // Use this for initialization
    17.     void Start()
    18.     {
    19.         theGM = FindObjectOfType<GameManager>();
    20.         //theGMscore = FindObjectOfType<GameManager>();
    21.  
    22.         //partical effects
    23.         fruitboxpe.SetActive(false);
    24.         fruitpe2.SetActive (false);
    25.  
    26.         gribseffectactivate.SetActive(false);
    27.         gribsdeactivateeffect.SetActive(false);
    28.     }
    29.  
    I know what my tips not powerful like MisterSkitz , but maybe this tips help you in your projects