Search Unity

Particle System's Velocity Over Lifetime module question

Discussion in 'General Graphics' started by VoxelNation, Oct 16, 2019.

  1. VoxelNation

    VoxelNation

    Joined:
    Jun 5, 2019
    Posts:
    10
    Hi, i was wondering if it would be somehow possible to have the rotatory properties of Velocity Over Lifetime module (orbital/offset/radial) be optionally performed around the particles Emit position rather than the Systems position? I'm in a situation, where im using a single particle system and then emit particles using EmitParams that have an emit position specified. This is working great aside from the fact that I can't really use the rotatory modifiers of Velocity Over Lifetime, cause they're performed around the entire systems game object position, which is just sitting at 0/0/0, as im not moving it anywhere and just use EmitParams for positioning.
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hi, I don't think it's possible via the built-in settings because the position passed to Emit isn't stored anywhere.

    I think it would be possible with some scripting though.

    Firstly, you would have to assign the emit position to the custom data via SetCustomParticleData.

    Next, you have 2 options:
    1. Write a custom shader that reads the emit position in the vertex shader, and applies the orbital behaviour based on the alive time or something.
    2. In Unity 2019, you can write your own modules in script that run using the C# Job System. So you could write a job that applies orbital velocity centered around the emit position, instead of using the built in module.
     
    VoxelNation and karl_jones like this.