Search Unity

Question How to move particle around Shape:Circle

Discussion in 'Visual Effect Graph' started by unity_ZicWyZDege2_nw, Nov 8, 2022.

  1. unity_ZicWyZDege2_nw

    unity_ZicWyZDege2_nw

    Joined:
    Nov 27, 2020
    Posts:
    4
    I creat a particle using set position:shape without set verlocity
    Now i want all that particle move around that shape:cirlce ( on line of circle )
    What should i do.
    upload_2022-11-8_21-6-51.png
     
  2. The_Storm_Rider

    The_Storm_Rider

    Joined:
    Jan 28, 2020
    Posts:
    66
    Well you know the radius and position of your circle, that's what you need. The block set position won't serve you anymore as it set a random position within this circle.

    Then how to move your particle ? Here is one way :
    - create a custom attribute called angularPosition
    - initialize this custom attribute, either by computing it from the position in the circle but you need quite some math with Acos and Asin, or more simply set this value a random value between 0 and 2.PI and skip the Set Position : Shape block.
    - update the custom attribute in time the way you want : constant angular speed or anything else.
    - set the particle position according to this attribute : circleCenter + (radius*Cos(angularPosition), radius*Sin(angularPosition), 0)
     
  3. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    194
    Morning.
    Moving the particle around the circle shape is something that is often asked.
    The simple method is to use a "Rotate3D" or "Rotate2D" block to rotate the position of the Particles around the Circle Axis.
    You can take a look at this Thread or to this one for more details as it has been already answered. They should give you a good explanation on how to achieve this.

    You can also take a look at the "Set position (Sequential: Circle)"as it can be an interesting behavior.

    Have a great day and don't hesitate to ask for more information if you're stuck after reading the linked thread.
     
  4. OuroborosDraconis

    OuroborosDraconis

    Joined:
    Oct 4, 2022
    Posts:
    49
    Hi, I am using a node that is called "Set Position (Shape: Arc Circle)" because I couldn't find a better way to directly take influence on the circular position of the particles. I think that's here also your problem with that your dealing. How ever in my approach I am defining the position of the particles (in my case static and evenly distributed) by the parameter "Arc Sequencer" I think it goes from 0 (= Circle start point) to 1 (= Circle end point). So if you divide 1 by the amount of particles you want (lets say 4), and multiply this factor with the particles ID+1, you should receive a circle with evenly distributed particles around its center (1st particle right, 2nd: bottom, 3rd: left and 4th on the top). So now that you have a way to take influence on the particles position you can start to build up a more complex mechanism to steer the position of the particles. For example you could scale the above mentioned factor with an other factor that is increasing it by time.

    upload_2022-11-17_15-10-46.png
    ( X, Y, Z defines only the center of the circle )