Search Unity

Question Can't replicate behaviors from Shuriken (Radial and Orbital velocity, Turbulence, Limit Velocity)

Discussion in 'Visual Effect Graph' started by Azeew, Sep 30, 2021.

  1. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    I'm trying to replicate orbital and radial velocity from Shuriken, for a particle system that needs both + Turbulence, while having something similar to Limit Velocity. But I just can't find a way to do it properly.

    Adding either of those is pretty easy. The problem I'm having is creating a composition of them in a scalable way.

    I could just play around with the position of the particles themselves:

    upload_2021-9-30_10-28-19.png

    But this doesn't work very well - I want the particles to align along their velocity, but this doesn't set any velocity. And I can't manipulate this velocity with additional logic later, so it's not very scalable.

    I could also play with the velocity directly:

    upload_2021-9-30_10-25-37.png

    But this creates a huge problem. It requires me to set the velocity to 0 every frame, to then add the amount. And this completely breaks other functionality, like Turbulence. For example:

    upload_2021-9-30_10-32-2.png

    This looks cute, but it just doesn't work. I need to set the intensity to a really huge amount for it to have any effect, and this way the particles just flicker like crazy. I believe it's cause Turbulence needs the velocity to flow from frame to frame for it to work properly, so that orbital/radial speed implementation gives it problems.

    I have no idea what to do... the effect I'm going for is so easy to replicate on Shuriken - I just tick all those boxes and they work perfectly together. Maybe I'm approaching these implementations in a completely wrong way to begin with.

    I'd really appreciate some help! Cheers :)
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

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

    You can do something like what Andy posted here.

    This should work well for most scenarios, but I believe the orbit will degrade over time if your particles need to stay alive for a long time.

    Alternatively, you can use the simple Rotate2D/3D operators like this:

    (the Delta Time multiplication is to make the rotation frame-rate independent)

    And if you want them to face a certain way, you can get the directional vector by doing something like this:


    Last bit if you see that your particles flicker, you can select Update and in the Inspector enable Skip Zero Delta Time:

    This will make sure that at higher frame rates you skip execution as you might get scenarios where your current and old position are the same and then the orient block won't know where to look :)

    Anywho, the end result should be quite stable and it should work well with turbulence:


    Hope this helps!
     

    Attached Files:

    Azeew likes this.
  3. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    @VladVNeykov Ahhh, you're such an MVP!! Thank you so much, that's all super helpful! The effect is working really well now. Cheers :)
     
    Vita- and VladVNeykov like this.