Answer the question
In order to leave comments, you need to log in
How to smoothly change color at the edges of a unity sprite?
There is such a sprite on the stage
how I can smoothly change the color of the gradient around the edges and so that the color change can be triggered through the code (let's say something happened in the game and I send a signal to change the color)
Answer the question
In order to leave comments, you need to log in
In short - one of the most adequate and simple ways - you need a gradient shader.
approximately what it is about, read here
https://answers.unity.com/questions/913898/horizon...
managing shader parameters from the code is also not difficult.
this class may still be useful to set the gradient itself in the script.
https://docs.unity3d.com/ScriptReference/Gradient.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question