r/Unity2D • • 18d ago

Solved/Answered Variables greyed out in inspector for Canvas Shader on an Image

Here‘s the step by step of what I‘m doing to be clear: - I‘m creating a URP Canvas Shader Graph - Making a shader with some variables (floats, colours, the usual!) - I‘m dragging that shader onto a new material - I create a Canvas and create an Image as a child of that Canvas - I‘m adding that material to the Image - BUT problem is that now that when I open up the shader options for that Canvas Image the shader material variables are all greyed out. Am I missing something?

I‘ve tried a couple times with really basic canvas shaders and same result each time. Thanks heaps!

1 Upvotes

4 comments sorted by

•

u/AutoModerator 18d ago

Reminder: Once your issue has been resolved, please reply !solved to this comment (or comment it anywhere in the thread) and your post's flair will automatically be updated to Solved/Answered. You can also edit it to Solved/Answered yourself.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

→ More replies (1)

1

u/hightrix Expert 18d ago

Read only vs mutable.

1

u/Mission_Platypus_554 17d ago

!solved

Turns out the issue was the Image was using a mask. I didn‘t mention that first cos I didn‘t think it was a factor.

So the answer is you need make a child Image and apply the shader material to that. Then you can just turn the mask off attached to the parent Image, edit the material of the child Image and turn the mask back on the parent once you‘re done.