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. Dismiss Notice

Resolved How would I achieve a staining effect like the game people playground has?

Discussion in '2D' started by Chazzwazzler, Jan 2, 2021.

  1. Chazzwazzler

    Chazzwazzler

    Joined:
    May 2, 2018
    Posts:
    35
    I want items to get stained with burn marks, blood marks, etc. I know I could use a sprite mask, but that would not change the separate pixels on a sprite and instead puts an overlay on them. Because my game is in pixel art, I would like to stain the separate pixels touched by something. I honestly have no idea how to do this, so I've come to the more experienced people (you all) to ask. How would I do this? Example image of the stains in people playground: upload_2021-1-1_21-33-38.png
     
  2. raarc

    raarc

    Joined:
    Jun 15, 2020
    Posts:
    535
    use texture2d.setpixels to draw blood on sprites in runtime
     
    Chazzwazzler likes this.
  3. adehm

    adehm

    Joined:
    May 3, 2017
    Posts:
    369
    Write a shader. Pass data about where the blood stain is on the object from a class in your project so your custom shader knows where to draw it.

    I doubt this would be a desired solution but maybe a turn based game it could work; but I imagine it would always cause a lag spike.
     
    Chazzwazzler likes this.