Hi,
i want a block to change to a different color when hitted by a ball, but i don’t want it to change color suddenly. i want it to change color over 0.5 sec from the point of contact over the whole block.
the side of the block is always the same and the block always consists of 6 sides.
how can i do this with shaders?
regards
you’ll need to use scripting to send timer values to the shader
Ok but time is the smallest problem, how do I lerp from point A to B. When lerping it does the whole mesh coloring. I uploade a clip now as an example.

you can either compute the UV’s of the object say with object or world or you can unwrap your model in your 3d editor visually front. From there you lerp or move a gradient over the uvs in the shader.
To start try making a shader that gets the UV’s of a unity cube in the shader .y value and + add a float from the editor between 0.0 to 1.0 You can make it a Range(0,1) = 0.5 to make it easier
That will get you started
The splat can be done with decals code in the shader later on
you should tinker with Book of Shaders https://thebookofshaders.com/ to get a feel for immediate idea testing of shaders input. Its gonna be much faster to learn the basics of ideas then just port the ideas with some naming changes back to unity