Looking for a way to rotate particles around themselves based on a predefined position

Hi,

I use a Sample Bezier node to position particles along a curve when they spawn. Now I would like them to rotate along the y axis at that position.

Anyone have an idea? Maybe @VladVNeykov ?

Here’s my initialize particle module:

Here’s how it looks like, you can see cubes where my points are:

You guessed it, I’m reworking my tornado and I want the particles to rotate around a point on that bezier curve.

I’m kinda lost. I tried Rotate 3D but it doesnt respect the bezier curve.

Thanks

Hey @marcrem ,

Here’s an example of how you can do this:

This will get you something like this:

You can also use the 0-1 value to change the rotation speed at different hights, the colors, etc.

I’ve put together a small package here of the effect above.
Hope this helps!

8356956--1099935--Unity_lJJ0n48C29.gif

Thank you so much! You are a savior. Any idea how to give particles an upward velocity that still follows that curve? it just needs to feel like it’s going up a bit

If you’re following Vlad Solution, you should be able to use the Tangent Vector Output from the Sample Bezier Block.
Multiply it by some strength and use it as Velocity in the initialize Particle Context.

I tried using it in a set velocity node in the initialize context, but the particles don’t exactly follow the curve. They actually offset themselves over time, so my tornado kinda doubles itself in waves

We can move our two Set Positions to the Output, and then just increment the position on the bezier curve:

I’ve also added a random gradient to visualize the result a bit better. With this, we get the following:

As a bonus, this will also enable you to move the bezier control points :slight_smile:

Hope this helps!


8358228--1100235--Unity_bcY9YkOG9I.gif
8358228--1100247--Unity_XKWTIBvYD6.gif

Thank you again so much! Great support as always.

I’ve been trying to plug this into my vfx graph which contains some more controls like particle size relative to the width of the tornado, some randomness, etc.

When I tried adding your “add value over lifetime” group and connect it to my system, it gave me really cool but weird results. Here’s my graph if you wanna take a look, I feel like I’m missing something when simply replacing the output of the first modulo and plugging it into the new group before everywhere else.

8362872–1101306–Tornado Test.zip (11.5 KB)

Hey @marcrem ,
Is what you attached the latest? It’s missing an output, the blocks are still in initialize, and it doesn’t have the “add value over lifetime” group:

Either way, it might be missing things if it’s not the latest, but I’ve added an output and integrated the bits into your effect (attached below). Btw, I quite like the directional change of the tornado you made! :slight_smile:

Hope this help!

8363316–1101453–Tornado Test.zip (20.2 KB)

Thanks, I tried your package and it confused me a lot as almost everything was moved to the output node and I use a lit output node as well.

It looks like not everything worked when I sent the vfx, so I made a package.

Here’s the features I added myself:

  • Particles scale up when the radius of the arc scales at that position
  • Rotation will go slower if the radius is bigger and faster if the radius is smaller
  • Particles are lit and are using a 4x4 sheet flipbook blend

The effect looks like this:
b4symk

Notice how I can move my bezier points and it will follow but only the newer particles will spawn correctly, the old ones are not moved. Probably because they’re not in the output node

Thanks again :slight_smile:

8364504–1101684–tornado test1.zip (5.95 MB)

So let’s say I move my blocks to the output node, I solve the problem of moving the bezier points, it now works perfectly. However, something’s suddently wrong with my particles, it looks like they’re having a party with strobe lights :stuck_out_tongue:

Edit: I also used Total Time (VFX) in the “rotate around the bezier curve” instead of delta time like you mentionned.
yd8rb4

And then if I try to add the value to make them go up, this happens:
oxxhpu

Here’s my latest package with what I mentionned above (Bezier works real-time, but everything flashes weirdly, and I can’t get upward movement to work) in case you want to compare the 2 rendering results.

8364708–1101708–tornado test2.zip (5.95 MB)

It looks very close, just some of the values were a bit high.
I’ve attached a package with smaller values and a few small connection changes

8364969–1101768–TornadoSample.zip (5.65 MB)
8364969--1101771--Unity_PBHJHQsv6L.gif

Thanks again.

I now have upward movement working, but there’s some things I’m not sure why they are happening.


Your note here, you’re dividing 0.05 by the lerp’s value, and then doing nothing, so I’m unsure why it’s there.

Now here in the following screenshot, my add-on to make particles rotate slower when the radius is larger is gone:

Strangely, if I do what I had done (next screenshot), it does make it faster on small radius and slower on bigger radius, but suddently it rotates the other way around and I can’t figure out why. It also slows it down way too much on the larger parts of the tornado:

Other than that, what really bothers me is why your screenshot doesn’t show the “flashing” effect while mine still does.
mmumcz

I know I’m asking a lot and I can’t thank you enough! I really wanna understand what’s going on there!

I tried using this originally, but the values were just too high so I left a note (but it’s confusing, yes, it’s not needed, you can delete it :))

It helps to visualize things. First, let’s see what the distribution of that Lerp for the TopFunnelWidth / BottomFunnelWidth looks like. We can plug in the value from the Add a value over lifetime to move particles up group to a color gradient in the Output and visualize it:

A linear interpolation between the top and bottom funnel width might not give you enough control to decide what part of the tornado should rotate at which speed (and it makes it at times harder to control two values to get the right look).

We can explore a simpler approach by using a curve. You can control the overall speed with just your Rotation Speed property, and use the curve to determine the distribution along the length of your tornado:

Here’s how that looks in action by modifying the curve:

Hm, maybe lowering the exposed Rotation Speed?

No worries! I’m not able to spend as much time on the forums these days as I’d like, but happy to help :slight_smile:

8371725--1103400--Unity_sLuc3MkIOz.gif
8371725--1103412--upload_2022-8-18_10-52-18.jpg
8371725--1103415--upload_2022-8-18_10-55-34.png
8371725--1103418--Unity_gUIxoZJ3ea.gif

Thanks, most of my issues are now fixed. Except that flashing effect that you clearly don’t get on your side.
Here’s an example, I tried with a lot less particles at the beginning to show you how it’s not rotating that fast. Then I add more particles and you’ll clearly see my problem:
3ov3go

Here’s another example to illustrate my problem:
kzk2vm

Same setting with 30 particles instead of 300:
8uw0n9

One last video: Is this a bug? I turn on the coloring, and it slows down rotation? The VFX Graph is not even attached to the Visual Effect.
4l66be

Alright so it’s really weird actually. Just noticed the rotation actually speeds up over time. Something has to be wrong on my side.

I place my VFX prefab on the scene, speed is fine. I wait for about a minute and it’s going about 2 times faster.

The rendering bug where particles are drastically changing their lighting keeps happening no matter what.

I tried to put my entire graph in a screenshot so it’s visible without downloading a package. There has to be something I messed up, but I can’t figure out why

Looks like there are two outstanding issues:

Flickering: to narrow this down, let’s check a few things.

  • Can you confirm that your flipbook is set right? (I see it’s 6x5 - just to confirm it’s not 5x6). Also what’s the range of the Set Tex Index over Life curve in your Output? What happens if you disable flipbooks and just have the default texture - does it still flicker?
  • Can you play around with lighting; turn off shadow casting or change the output from lit to unlit (you can right click on the output and pick Convert Output:

  • A few other potential things to look into: check sorting, start disabling blocks one at a time in the output, and try reducing the capacity (just in case it’s some local error).

Rotation Speed increase

  • Yup, happens for me too! Looked into it, I think the second Total Time (VFX) is unnecessary, as we are already feeding time earlier in the logic so it was growing exponentially. Just remove this and increase the rotation value a bit:

8383212--1105548--upload_2022-8-23_11-10-43.png