Search Unity

How do you rotate the spawn position of a particle system?

Discussion in 'Visual Effect Graph' started by Stacklucker, Feb 28, 2020.

  1. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    When I initialize my particle in the VFX Graph, I can freely choose the spawn position and spawn shape, but what about rotation?

    Let's say I want to initialize my particles on the surface of a circle. Is there anyway to rotate the whole circle? I don't want my particles to spawn parallel to the ground level, but in specific rotational angles.

    Thanks for any help in advance.
     
    hipinds likes this.
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Stacklucker ,
    You can transform the positions and re-assign them to the graph. Something like this:
    upload_2020-2-28_17-5-14.png

    Hope this helps!

    Edit: this workaround is no longer necessary, the workflow has been improved (link)
     
    Last edited: May 16, 2022
  3. Kikimacia

    Kikimacia

    Joined:
    Jan 27, 2020
    Posts:
    17
    @VladVNeykov Oh man, I didn't even come on the forum for this but you made my day, I've been looking for this for 2 weeks now ! Thanks !
     
    pjbaron and VladVNeykov like this.
  4. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    @VladVNeykov sorry for my late response, but thank you so much for your detailed response. It worked!
     
    VladVNeykov likes this.
  5. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    The thing is that you can also rotate the emitter and it will work, unless you are in world space, then you will have no choice but rotating yourself the emitter, which is a bit annoying, specially because the gizmo is then wrong (showing the false orientation). It would be great to have a rotation option (as well as offset and scaling, all non uniform) like in Shuriken.

    So right now in vfxgraph, if you want world based particle emission but also want to adapt the rotation of the emitter based on its parent (let's say a exhaust pipe from a car), you can't do it (good luck trying to find the correct rotation).
     
    ESludden likes this.
  6. ESludden

    ESludden

    Joined:
    Aug 27, 2012
    Posts:
    19
    @cAyouMontreal Yes, It would be useful to have a simple way to choose 'Simulate in worldspace' for the whole particle effect.

    Shuriken has this option as a dropdown menu item in its 'Simulation Space' attribute. Are there any plans to make this feature available in VFX Graph?

    I'm keen to have a worldpsace simulation so that I can take advantage of the performance of VFX Graph when my particle emitter moves and rotates its Transform in the game world.
     
  7. AidenEcho

    AidenEcho

    Joined:
    Sep 23, 2018
    Posts:
    2
    Thanks to all guys. I tried to create a VFX and I used the "Position (Circle)" node, however the "Position (Circle)" node can't be rotated, so I rotated the VFX and used the Transform node to convert the position that I passed from parameters.
     
    VladVNeykov likes this.
  8. pjbaron

    pjbaron

    Joined:
    Jan 12, 2017
    Posts:
    53
    The solution above worked perfectly for my simple case (I needed a hemisphere emitter flat on the ground, the default arc slices it vertically).
    I believe you can use world space rotations by exposing the Transform (Position) as a Property and setting it to match your (e.g.) exhaust pipe.
    Apologies if I get this wrong, but I think that what we're doing here is directly applying the transform to every particle as it is created and before it appears in the world, which makes this technique incredibly powerful (you can do anything to your emitters).
    My only criticism is that it's entirely obscure, there's no way I would have thought this might work if I hadn't found this thread.
    upload_2020-6-8_17-30-10.png
     

    Attached Files:

    Livealot and ESludden like this.
  9. ctedin187

    ctedin187

    Joined:
    Aug 20, 2018
    Posts:
    11
    Yay! I'm giving this a try. I asked in another part of the forum, but thought I'd stumble across it.
     
    VladVNeykov likes this.
  10. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Exactly!

    Completely agree; we are aware that this is not very discoverable, and are planning on addressing it at the shape block level itself.
     
    Mehrdad995 and pjbaron like this.
  11. surits14

    surits14

    Joined:
    Jan 22, 2018
    Posts:
    22
    Last edited: Jun 26, 2020
    VladVNeykov likes this.
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Have you?
     

    Attached Files:

  13. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    There's a PR in progress at the moment addressing this.
     
    laurentlavigne likes this.
  14. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    In some situations instead of full fledged rotation 90 deg you can just swap y<->z position components.
     
    laurentlavigne likes this.
  15. dnlbschff

    dnlbschff

    Joined:
    Nov 1, 2016
    Posts:
    2
    It would be cool, if the shape Gizmo for the attached GameObject would be rotated with the shape block transform then as well.
     
  16. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I have been trying to figure this out for several days now.

    How do I do the same without the circle. I want to set the local rotation of the particle to x=90 while the particle system is in world space. Using angle (x=90) works as long as the system is in local space but when I switch to world space then it sets the world rotation to 90.

    Is there a block like chance space for angles?
     
    Last edited: May 21, 2021
  17. iDerp69

    iDerp69

    Joined:
    Oct 27, 2018
    Posts:
    49
    @VladVNeykov I have been struggling with this for days... consulting help on the official Unity VFX Discord channel and nothing we've tried was able to get my VFX to work the way I'm intending. I'm trying to make action/speed lines for my vehicle-based game... simple speed trails that whiz by you as you drive fast. You would expect these to come from a torus shape in front of the vehicle in a heads/trails system, but I cannot get the torus to rotate. If there was a way to rotate the emitter directly on the Set Position Torus node, that would be extraordinarily helpful in making VFX graph a bit more beginner friendly. I am not the only one who is struggling with this as someone else was having essentially the same issue in that Discord at the same time.
     
  18. homemacai

    homemacai

    Joined:
    Jul 22, 2020
    Posts:
    74
    So there is no way to rotate the emitters when suing World Space?
     
    Last edited: May 21, 2021
  19. mbach

    mbach

    Joined:
    Oct 25, 2018
    Posts:
    7
    I am also struggling with this. The fact that emitters do not rotate when the system is in world space mode is very confusing and I don't know how to work around it. Please fix this, Unity. The trick that was suggested only works for systems in local space.
     
  20. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi all,
    A quick update, in Unity 2021.2 we have now embedded transforms in the various shape blocks and operators, allowing you to easily move, rotate, or even scale shapes. Hope this makes things easier now! :)
     

    Attached Files:

    Gooren, Rowlan, MagiJedi and 8 others like this.
  21. Colendro

    Colendro

    Joined:
    Oct 28, 2021
    Posts:
    1
    @VladVNeykov
    Welp, the year is 2022 and the Get Attribute: position + Transform does not do it for me.
    Neither is there any sign of Angles in the Set Position (Shape: Circle)
    Any ideas?
     
  22. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Colendro! Are you adding a new shape block or opening some older project/effect?
    To not break compatibility we've kept the old shape blocks (like Set Position (Shape: Circle)), but adding a new block (Set Position (Shape: Arc Circle)) should have a transform which will allow you to modify the shape's angles.

    And to confirm, you must be in Unity 2021.2 or later to access these.
     
    Ofenkatze likes this.
  23. matthoadrobson

    matthoadrobson

    Joined:
    Dec 30, 2017
    Posts:
    10
    Is there a way to do this with AABox?
     
  24. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,307
    It's not. AABox (axis aligned box) by defnition is aligned to coordinate system, however I think it sounds like nice feature to add - Set position from shape: oriented box.
     
    olwynn, Gooren and Slaktarkuno like this.
  25. Slaktarkuno

    Slaktarkuno

    Joined:
    Dec 3, 2021
    Posts:
    10
    If your particles are in World Space, you can do this with the AA box by doing this. The WS Transform is fed through a property binder.
    upload_2022-10-10_11-51-9.png

    If the particles are in local space, do this:
    upload_2022-10-10_11-55-57.png
     
    olwynn likes this.