does anyone know how to scale particle based on velocity.
for example stretch a spark fx to make it longer.
is it possible to set the particle emmision angle also?, couldnt get to work either see image to what im trying to achieve

the smoke puffs should burst outwards and be stretched , the main explosion works fine

  • xyz replied to this.

    DJMaesen When you emit a particle you need to pass transform and velocity arguments. Simply adjust your transform basis (orient and scale) according to the velocity vector. Since @award took interest in the topic, I'll let him write the exact recipe 😉

    I'm actually unsure now, because I assumed when @DJMaesen said "velocity" that they meant the velocity of the particle, but it could also be referring to the velocity of the particle system, as xyz is supposing.

    • xyz replied to this.

      award No, I meant the individual particle velocity.

      Well, in that case

      @DJMaesen you have options to tinker around with to get exactly the effect you want. Most of them are inside of the ParticleProcessMaterial.

      Display/Scale will directly control the scale of the particles. You can set the min and max and it will give each particle a random scale between the two. If min == max, then it will always be that size.

      If you want to scale particles based on how fast they are going, then you can use Scale over Velocity Curve. It's a bit finicky, unfortunately. Often it is much easier to use Scale Curve instead. Scale Curve lets you directly control the scale of particle over its lifespan. When you edit the curve, the far left is when the particle spawns, and the far right is when it despawns. The time will depend on however long the particle is alive for, so if you double a particle's lifetime, then it will scale half as fast. If you want to stretch in one direction rather than scale uniformly, just use a CurveXYZTexture instead of a CurveTexture.

      Now, if you're certain you want to stretch based on velocity and not time, there is a bit more to Scale over Velocity Curve. First, be aware that it scales based on SPEED, not velocity. It won't care what direction your particles are moving in. You can edit the curve similarly to Scale Curve, but rather than the left being Time=0 and the right being Time=Lifetime, the left is Scale over Velocity Min and the right is Scale over Velocity Max. Those values correlate to the speed of the particle. If the fastest your particle moves is 2 m/s when it starts and then it slows down to 0, you would want min to be 0 and max to be 2. Then, if you want the particle to expand as it slows down, you'd want the curve to be high on the left and low on the right.

      As for controlling the speed of the particle, you have a bunch of options, but let me know if you'd like an explanation of that. An important thing to note is that if you're using Scale over Velocity, then it's important to keep your acceleration and velocity only in one direction. For example, if you have a particle which starts moving downward, then moves upward, then slows to zero, its speed will be zero twice, which might cause it to scale up then back down then up again. Probably not what you want.

      As to changing the emission angle, there are a couple of ways of doing that. The most straightforward is Spawn / Velocity / Spread. This works great if you are supplying an initial velocity and you are emitting from a point under Spawn / Position / Emission Shape. However, if you aren't supplying an initial velocity it does nothing, and if you're using a different emission shape it can look weird as particles will move at a random angle regardless of where in the shape they are.

      I find that a good solution in a scenario like yours is using a combination of setting Animated Velocity / Radial Velocity and moving Spawn / Velocity / Velocity Pivot. Because radial velocity is in the opposite direction from the pivot, moving the pivot gives you good control over the angle. You can calculate out the distance to set the pivot for the angle you want, or you can just move it around until you get what looks right.

      For example, in a particle system like yours, you might want the particles to start slightly spread out from each other in a disk shape so that they aren't all clearly spawning from the same point. You can use a Ring for the Emission shape to get that. Then if you move your pivot only in the direction of Emission Ring Axis, you can easily emit in a cone with a precise angle. The angle will be equal to arctan(Emission Ring Radius / the offset of Velocity Pivot)

      Hopefully that covers everything you wanted to do with these particles. Let me know if you have further questions.

        award i cant get it work to spawn particles in an upward cone like i want
        but your info did help

        • xyz replied to this.

          DJMaesen Under Spawn/Velocity set direction to (0,1,0), set spread angle and initial min/max velocity. Set Accelerations/Gravitiy to (0,0,0). The particles should then go in an upward cone.