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.

Resolved Is there a way to make a smoke trail not follow a burning creature when it moves?

Discussion in 'Visual Effect Graph' started by ZeHgS, Jun 4, 2022.

  1. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    Hello!

    I am making a fire effect that will burn mobile creatures.

    Is there a way to make already-emitted particles not follow a burning creature while still having the FX as a child of the creature's so new particles are still emitted from the right place to leave a more realistic smoke trail or do I have to simulate it by adding forces by script?

    The only link I found talking about this was this one https://www.reddit.com/r/Unity3D/comments/aohidx/visual_effects_graph_fog_emitting_particles_in/

    I followed the commenters' instructions, as far as I understood them, but it didn't work. This is in Initialize, though I have also tried putting it in Update:

    upload_2022-6-4_16-52-40.png

    and I have a Force block in Update as well.

    Thanks a lot!
     
    Last edited: Jun 5, 2022
  2. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    I figured it out with the help of two people on Reddit. I needed to plug in an exposed variable to Set Position instead, which I then change by script. I had to separate my fire effect from my smoke effect, though, so that the Fire effect can still be a child of the creature while the smoke effect is outside this subhierarchy.

    Thanks!
     
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    805
    Maybe I misunderstood something, but this is not how it's done.

    You don't need to expose anything to make it work, you just add Set Position block set to (0,0,0) in local space (L), this makes your particles to spawn in zero of your your game object, and then you set simulation space (of system) to world space, so particles do not move with that object. This way even if you move it, your particles will stay in spawn position. Almost everything is in documentation. On the bottom of this page you can find description of simulation space.
     
    ZeHgS likes this.
  4. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    Thanks a lot for replying!

    Damn, it worked! I didn't know about changing the simulation space of the whole system. Thanks a lot!

    Really? My experience has been that the documentation is lacking so many basic things and whatever there is seems to be incomplete. Maybe I just suck at searching. For instance, I couldn't find a page for "set size over life", I couldn't find a description of the difference between "Flipbook motion blend" and "flipbook blend" and multiple other little things like that, these two are just the latest ones. At least nothing shows up when I google it within quotes or when I use the doc's own search engine. Look:

    upload_2022-6-5_9-7-20.png

    I really appreciate all the help you've given me here in the forums, thanks a lot! It's been kind of hard learning VFX Graph even though the mechanics are so intuitive and it's so awesome. It seems like there are so few resources online. With other, more well-established Unity features it seems like very question has been asked before so it's very easy to find solutions to problems.

    For instance, one of my flipbooks isn't looping so the smoke trail just disappears after it rises beyond a certain point. The only topic I found about it is this one https://forum.unity.com/threads/flipbook-not-looping.850501/ with no real explanation as to why this particular flipbook isn't looping and one solution that seems that it isn't really the right one. All other flipbooks seem to loop. Do you happen to know what could cause this?

    Thanks again!
     
  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    805
    Well, to be honest the search feature kind off suck, but docs itself are quite good when it comes to explaining all basic fatures. Sure, it's not like you can find all answers there, but I guess there are no docs in the world to cover all possible questions.

    Anyway, what I meant is that reading whole docs is good strategy as it helps to understand how this tool works and it should answer most of basic stuff. Obvsiously this is not enough for more complex scenarios, but it's good start.
    In addition, if there are missing features or docs pages you can report it or ask here and expect answer from devs, unlike other forum sections :)
     
  6. mcbauer

    mcbauer

    Joined:
    Oct 10, 2015
    Posts:
    486
    @Qriva thanks for this, such a simple behavior that is out-of-the-box with the legacy particle system. This setup should be the default behavior for new graphs.

    For anyone reading this later, here is the trick

    vfxgraph.jpg
     
    ZeHgS likes this.