Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

how to spawn particles in a line on the x axis at random?

Discussion in 'Visual Effect Graph' started by RadilMahbub, Dec 23, 2021.

  1. RadilMahbub

    RadilMahbub

    Joined:
    Jul 26, 2021
    Posts:
    8
    Hello everyone, I need some urgent help, I am making a VFX particle graph for making fireworks. now I want them to spawn in a line on the x axis at random.
    However there is no node for me to use, I have seen a brackeys video that tell me to use a node called Position '(line)'. However, I cant find any blocks with this name,I would really like some help on the matter.

    link to the tutorial I followed:


    Thank you in advance
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @RadilMahbub ,

    There is a Line Position block; you can right click on top of your Initialize context and type "line":
    upload_2022-1-5_16-29-10.png
    Note: make sure you are looking for blocks (i.e. on top of a context like Initialize) and not for nodes (i.e. when you click outside of the graph in an empty space).

    Alternatively, you can also simply add a Set Position block and add a random number to it's X axis. In this example, we are setting a position randomly between (-2,0,0) and (2,0,0):


    Hope this helps!
     

    Attached Files: