S
S
StynuBlizz2019-09-16 13:41:01
Unity
StynuBlizz, 2019-09-16 13:41:01

How to smoothly change color at the edges of a unity sprite?

There is such a sprite on the stage
5d7f664704efd934227314.png
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

1 answer(s)
D
Denis Gaydak, 2019-09-16
@StynuBlizz

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 question

Ask a Question

731 491 924 answers to any question