Turning 2D Sprite Into Ashes

Hello everyone,

I have a lightning strike in my 2D game, all gameobjects are composed of sprites, what I want to do is turn any object hit by lightning strike to ashes, The problem is that some of these objects are characters that have animations and a lot of different equipment of different size.

So my question is, is there any way how can I convert sprite into ashes that will fall down and form ash pile?

Since I’m not good at scripting shaders, I don’t know if it’s even possible with shaders.
But I have one ideea of how it could work, let’s say I will have another sprite which will be a little black dot, then after anything is hit by lightning strike, I will spawn a lot of these little black dots all across the sprite surface. Is somehow possible to get the sprite surface in pixels for example?

Thanks

I suggest you look into “dissolve” shaders, which can be used to achieve various effects like this. Here’s an example: DevBlog - Code Avarice

How about spawning a particle system affected by gravity? Unitys built in particles are very optimized and will probably give you the result you are looking for if you set them to ‘affected by gravity’. Make the particle system a prefab and have your gameobjects spawn it if they die by lightning. GL :slight_smile: