Search Unity

Disable sheet animation on an individual particle?

Discussion in 'Scripting' started by vexe, Feb 19, 2020.

  1. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    Hi all,

    we have a "bush-hit" particle system that plays when a bush is hit. It uses a texture sheet animation with FPS time mode to animate the particles from a texture sheet. There's also a plane with a collider underneath the particle system that particles collide with.

    We want to be able to stop a particle from animating once it hits the collider on the plane, but it doesn't seem to be a public way to do that? I can turn on/off the entire sprite sheet animation module but that's not what we want, and there's nothing on the Particle struct that has to do with it animating.

    Any pointers are appreciated.

    Cheers!
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    I don't think there's a way to do so, one way I can think of is when the collision is detected destroy said particle and instantiate another one.
     
  3. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    Yeah I thought of that, but I'd need to get the sprite frame the particle was at when it collided so I can use it when I spawn in the new dummy object otherwise it wouldn't look right, and I don't see a way of getting that either lol.

    I'm pretty sure they're able to do all these things per particle it's just not exposed, kinda lame.
     
  4. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536