Linearly changing an object's material/color

Hi guys, I’m trying to figure out how to go about having an object basically be “filled” with a color, or have it able to appear as it’s emptying out from one end of the model to another, and done via script. Obviously I’d want this done along world coordinates, not texture coordinates. To get my point across…

I’m guessing I may need a special shader to achieve this, in which case this thread might need to be moved. I saw some dissolve shader packs on the store though I’m not sure it’s what I’m looking for. Like I said at the start, I need it to change colors or materials linearly, preferably along an axis I’m able to define somehow.

Any help’s very appreciated.

There’s a free to download blend shader on the asset store. It basically just holds two textures with some blend values. I bet you could tweak it a little then use the mainTexture offset. This may take a little UV planning as well.

Yea that’s the thing, I only plan to use solid colors (models without even uv mapping, just colored materials) but ideally I’d be able to use it for textured objects as well. Pretty confusing, and I don’t know the first thing about shader creation anyway.