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.

Question Path following problem

Discussion in 'Visual Effect Graph' started by Linkruste, Nov 11, 2022.

  1. Linkruste

    Linkruste

    Joined:
    Oct 30, 2021
    Posts:
    12
    Hello, I'm a Unity's VFX Graph begginer and I'm stuck on a problem with moving particles.
    I tried to follow some tutorials on YouTube and Unity's Documentation about making particles following a line but it just does not work for me, my particles are stuck on starting point wherever the second, third or fourth is or sometimes just go straight-forward on a line I can't edit.

    I'm trying to use the "Sample Bezier" block with a custom property named "Progress", as the tutorial I saw told me.

    I'm using Unity's HDRP (High-Definition Render Pipeline).

    Can someone out there help me ?

    On the screenshot, I selected the "D" point of the curve, and we can see the particles obviously don't go there. upload_2022-11-11_21-11-6.png

    Thank you in advance for your help !
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    816
    It depends what you need. Your graph sets some random velocity completely independent of curve, so this is probably why they move. You set position from curve every frame, but it will be always the same: 0. The reason is you divide spawn index by 100, but it's uint, so the result will be also uint. Click the gear with arrow in corner and change it to float.

    Anyway, if you want to move particles over time you can do this:
    upload_2022-11-12_1-26-46.png

    Or if you want to spawn them on curve evenly try this:
    upload_2022-11-12_1-32-2.png
    Note: the spawnCount location must be Source in the second example.
     
    OrsonFavrel and Linkruste like this.
  3. Linkruste

    Linkruste

    Joined:
    Oct 30, 2021
    Posts:
    12
    Thank you a lot !

    It worked

    I changed the return type of division by error and didn't thought any second that it could mess all the graph up...

    Have a nice day, I'll try to think better !
     
  4. Linkruste

    Linkruste

    Joined:
    Oct 30, 2021
    Posts:
    12
    You seems to be experienced with Shader Graph, maybe you could help me with this one ? Thank you in advance !