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

Difficulties enabling/disabling shader at runtime

Discussion in 'Shaders' started by omatase, Nov 30, 2014.

  1. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    I have a shader that I've created that I am using to draw an outline around the Sprite assigned to my Sprite Renderer component on a prefab. I want to enable / disable the shader to draw an outline around the character when they are selected but when I disable the shader the image stops displaying and when I change the shader to the standard Diffuse shader the image stops displaying. And finally, I have several of the same prefabs in the scene and whenever I remove the shader on even one prefaball my prefabs stop displaying at once.

    here is a screenshot of my prefab configuration.

    Capture.JPG

    Appreciate the help finding out what I'm doing wrong.
     
  2. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    Dang it. Wouldn't you know, every time I think I'm submitting a question I'm sure I can't figure out on my own I solve it right away. Sorry, nothing to see here :)

    Just needed to swap the material, not the shader.
     
    Last edited: Nov 30, 2014
  3. fnaimi

    fnaimi

    Joined:
    Jul 10, 2020
    Posts:
    2
    Thank you from the future!!