Death animation then become grey

After messing around with material and shader, I succeeded in rendering the player with grayscale after his/her death.

4-tilevania-death_xg

These were the steps, I did:

  1. Create a new Material
  2. Set the material Shader to Sprites/Default
  3. Apply the material to the player sprite
  4. Create a new Shader
  5. Copy/Paste the Shader code from here https://forum.unity.com/threads/sprite-shader-with-greyscale.222693/, thank you RChrispy
  6. in PlayerMovement change the material shader
    GetComponent<SpriteRenderer>().material.shader = Shader.Find("Sprites/GrayScale");
7 Likes

Very cool animation

nice! It looks very good.

How did you do it so character wouldn’t get pushed around by enemy?

The enemy CapsuleCollider2D is set as IsTrigger.
It doesn’t compute physics interactions with the player.

Privacy & Terms