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.
  2. Dismiss Notice

Question How to apply a force to different target

Discussion in 'General Graphics' started by A_Gamgie, Apr 14, 2023.

  1. A_Gamgie

    A_Gamgie

    Joined:
    Mar 30, 2013
    Posts:
    9
    Hello,

    I want to create a force that attract particle in a vfxhraph : This is done and work.
    I want to have a list of target point : I made it using graphicsBuffer and it works

    upload_2023-4-14_20-45-6.png

    But, the way I go through buffer is by using a modulo on frame index. Which is not physically accurate. I want to go through all target, add all forces for each particle and then apply the force.

    Basically, I want to loop on each buffer index to compute the force and add all the forces. But this is where I struggle to make it done.

    Do you have any suggestion or tips to do this ?

    Thanks a lot.
     
  2. A_Gamgie

    A_Gamgie

    Joined:
    Mar 30, 2013
    Posts:
    9
    hello

    This is a up message. I still not find an option.

    Basically, how can I loop in vfxgraph ?
    Or maybe create a local variable I can use each frame to store past values ?

    Thanks for helping