Search Unity

Need help with a Smoke/Mist effect

Discussion in 'General Discussion' started by Boingloins, Mar 19, 2021.

  1. Boingloins

    Boingloins

    Joined:
    Feb 9, 2021
    Posts:
    7
    I would like a character in my game to have the ability to transform into a black mist, (in my head it sort of looks like sand?) I tested out using a Particle System, but it took a massive toll on the framerate. (It's possible I was using it wrong, seeing as this is my first time dealing with a Particle System.) Basically, I have no idea how to go about this. Should I use a Particle System? Is it possible to make a simulation with Blender and import it into Unity? Any help would be much appreciated.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    Yes. Typically if your character transforms into a CLOUD of mist, you hide the model and spawn a particle that produces cloud. And if you want a walking shape, then you attach particle systems to object's bones. THen configure them.

    "Massive toll" means that you're spawning too many particles.

    Technically yes (you'll have to code it), practically, no and it is not really worth it.
     
    tree_arb likes this.
  3. pekdata

    pekdata

    Joined:
    Mar 16, 2019
    Posts:
    114
    I guess for advanced cinematics it would be cool to puff particles at vertex positions or something?
     
  4. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    If you need alot of particles you propably want to go with a GPU particle system.

    Unity is still a CPU based particle system.
     
  5. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    Effects Graph offers a GPU based particle solution.
     
    MDADigital likes this.
  6. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Can you migrate standard unity particles to it?
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,025
     
    Socrates likes this.
  8. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    Interconnectivity between systems? In Unity?

    Of course not. It's not even compatible with the most commonly used render pipeline.
     
  9. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    :)
     
  10. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    324
    Can you elaborate a little bit on this? My particle system experience is limited, but I think there is a collision section right? So are you saying to add particles to each bone and have it roll off its own collider or something to thst effect?
     
  11. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    You don't NEED a collider. Just attach a cylinder/box/whatever particle system emitter to a bone, and set it to work in worldspace and spawn particles and have them pass through everything.

    That will result in a "smoking humanoid" effect.
     
    Last edited: Mar 22, 2021
    tree_arb likes this.
  12. Boingloins

    Boingloins

    Joined:
    Feb 9, 2021
    Posts:
    7
    That sounds very good, but I'm not sure what kind of particle to use. (It would be cool if it could look something like flowing black sand maybe.)

    Also, thank you all for the replies!
     
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,025
  14. Boingloins

    Boingloins

    Joined:
    Feb 9, 2021
    Posts:
    7
    This is definitely more what I wanted, but there were two problems. First, I couldn't seem to find the "Set Position (Shape: Mesh) (Position)" block. Second, I can't wrap my head around code at all. So, I found a fix for both of them at the same time.

    Instead of using the Position (Mesh) block, use the "Set Position From Map" block. Then go to "Window > Visual Effects > Utilities > Point Cache Bake Tool" to turn the character model into a Point Cache. Put that Point Cache asset into a Point Cache Node in the VFX Graph. Connect the "AttributeMap : position" slot on the node to the "Attribute Map" slot on the "Set Position From Map" block. I didn't have to code at all, and I finally got an awesome flowing black sand effect in the shape of the character!

    Thank you all!
     
    Billy4184 likes this.
  15. Boingloins

    Boingloins

    Joined:
    Feb 9, 2021
    Posts:
    7
    Of course, when using this method, the mesh is static, so there is one down side. But since my character disappears into the black mist, it's fine. It's also cool to faintly see the character's floating silhouette in the mist.
     
  16. alti

    alti

    Joined:
    Jan 8, 2014
    Posts:
    94
    yeah im missing the set position shape: mesh attribute as well. What gives?
     
  17. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    @Boingloins
    You can use a combination of using less particles, with an animated texture of black moving mist, that eventually fades away and disappears, for an effect like that. If done properly, you'll see how good the results look. But it will take some time and effort, to make it look legit.
     
    Last edited: May 7, 2021