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.

VFX Graph question: Scale the VFX system without affecting particle scale?

Discussion in 'General Graphics' started by dgoyette, Oct 19, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,055
    I'm trying to create an object that's somewhat dynamic, so that I can scale a parent object and have everything inside it scale nicely with it. Often this involves adjusting the tiling of some shader, and adjusting the Box dimensions of things like a particle system.

    One thing I've noticed is that if I change the scale of a VFX Graph object, the individual particles are affected by this scale change. And I haven't found a property to set to make the particles always the same size regardless of parent scale. Does anyone know what I need to add to my graph to keep parent scale changes from affecting the stretching of individual particles? I'm using a "Quad Output" node for the output.
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    293
    Your particles need to be simulated in world space if you dont want the scale to affect them. Then you need to handle the scale wherever you want in your graph to get the behaviour you want (Beware of which inputs are in scale or world space)
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,055
    Okay, so just like in Shuriken then. Thanks. I didn't see how to choose to simulate in world space in VFX Graph, but I'll take a closer look knowing it exists there somewhere.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,055
    In case anyone else struggles to find this, it's simple: When selecting various nodes in VFX Graph, you'll see you can adjust some properties in the Unity Inspector:

    upload_2019-10-20_15-20-31.png
     
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,055
    Maybe you/someone can help me out a bit more. I changed the Quad Output's Space to World. Although this does cause the particles to now stay the same size when scaling the particle system, it also has an unwanted side effect of making the "Position (AABox)" no longer rotatable. Under "local" simulation, rotating the VFX object causes the Position box to rotate. But with "world" simulation, rotation no longer affects the box.

    Is there a way to get both scale-independent particle size, along with the ability to rotate the VFX object arbitrarily to adjust the spawn volume? To put it another way, in Shuriken, I can set the Scaling Mode to "Shape", which causes the particles to remain constant when scaling, but still allows the particle system to be rotated as expected.
     
    Last edited: Oct 20, 2019
    StevenVis likes this.
  6. StevenVis

    StevenVis

    Joined:
    Oct 24, 2017
    Posts:
    1

    I've been having this exact problem and have been trying for hours to get a fix. Have you found any temporary solutions yet?
     
  7. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240
  8. RockManRK

    RockManRK

    Joined:
    Mar 11, 2019
    Posts:
    1
    Guys, just add this in the end of the visual effect graph. I tested here and it worked. upload_2021-3-29_17-54-37.png
     
  9. imorb

    imorb

    Joined:
    Apr 27, 2021
    Posts:
    1
    It works only if you don't rotate your sprites. At the moment you do, they are stretching. Idk, either I'm dumb or Unity is not my engine.
     
  10. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    1,958
    We don't want scale to be affecting our particles.
    But we do want position and rotation of transform to affect them.

    My use case:
    I have got an object with a MeshRenderer lets call it ROCK.
    I'm parenting my vfx GameObject lets call it MASHROOMS to this ROCK.
    My vfx is using MeshPosition block and ROCK mesh to place mashroms particles on a rock.

    Now when I scale this ROCK, position of mashroms is correct, still spawned on a ROCK but their scale is also changing.
    And I want mashroms to be the same size always.
     
  11. unity_483C4357D3269025FA3B

    unity_483C4357D3269025FA3B

    Joined:
    Jul 2, 2022
    Posts:
    12
    Same here. Trying to spawn water bubbles that always have the same size and scale, however the gameObjects and the VFX it is attached to, obviously change in size depending on the waterbody size.