I am making a 2D game with a textured and tiled background. The background needs to change periodically throughout the stage. I need to know how to change the textures color through an animation?
Several approaches are possible
- You could animate the background itself in maya (if its a 3d quad/plane) and change the vertex colors, which a shader could use to change colors/ manipulate the look of it.
- change the material’s color property with a script, for example based on an AnimationCurve, and use that value to lerp between X amount of colors, with a speed/timing to your liking.
- I think you could also use Unity’s Animation system to animatie a material’s color property, that way you can build your coloring animation for that object.
- there are more options, but these are the first to pop in my head.