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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Reversed motion of elements in ParticleSystem

Discussion in 'General Discussion' started by mondeon, Sep 21, 2016.

  1. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    Hello Unity Community!

    I want to make a "simple" particleSystem, where the movement of the elements is reversed: particle elements appear at a given distance (+ maximum random spread) and accelerate and move towards the center of the particleSystem. Imagine a black hole that is pulling and consuming light and matter...

    How can I achieve such an effect with a ParticleSystem? Is that even possible in Unity 5.4?
     
  2. ErisCaffee

    ErisCaffee

    Joined:
    Nov 26, 2014
    Posts:
    127
    It looks like you might be able to do this with the Legacy particle system, but I really don't know the details.

    http://answers.unity3d.com/questions/138207/inverted-particle-emitter.html

    [EDIT]

    Yeah, OK I was able to set this up pretty quickly.

    Create an empty GameObject to hold the particles. Add components:
    - Ellipsoid Particle Emitter
    - Particle Animator
    - Particle Renderer

    In the Ellipsoid Particle Emitter, set the Tangent Velocity to (0,0,-1), set the Min Energy to to 2, the Max Energy to 1, and the Ellipsoid to (5,5,5). This creates a simple implosion type effect.

    It's not perfect - some of the particles keep going after reaching the center so that they start moving outward again, but I bet if you play with the settings that you could get it to work right for you. It might be as simple as adjusting the size and scale so that the overshoot of the center becomes unnoticeable.
     
    Last edited: Sep 21, 2016
    HaruLee932001 likes this.
  3. ErisCaffee

    ErisCaffee

    Joined:
    Nov 26, 2014
    Posts:
    127
    Min Energy 0.1
    Max Energy 1
    Tangent Velocity (0,0,-4)

    seems to work pretty well.
     
    HaruLee932001 likes this.
  4. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    Thank you, @ErisCaffee, it's really working!
    I still hope that someone can figure out a solution with the current particle system, because at some of the future release the Legacy particle system might just disappear..
     
    HaruLee932001 likes this.
  5. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    With the particle system, set the start speed to negative, make the shape a sphere that emits from shell, set collision to world and have a lifetime lose of 1, and put a collider inside with it's layers set to collide with the particles.
     
    mondeon and ErisCaffee like this.
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I wouldn't bother with the collision, collisions with particles can get expensive fast. Instead you can manipulate the start lifetime so that particles die when they reach the centre.

    If you are going with collisions set it up against a single collider, rather then world.
     
    mondeon likes this.
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,986
    They have already announced its removal.
     
    Kiwasi likes this.
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    zombiegorilla and Ryiah like this.
  9. mondeon

    mondeon

    Joined:
    May 29, 2015
    Posts:
    46
    Thank you very much, all! Gonna test that tomorrow :)
     
  10. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,986
    Mix in a little add force using the remaining life as a modifier, and you can get some fun effects pretty quickly.
     
    Kiwasi likes this.