Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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