(Newbie) Trying to script an adjustable wet/dry material for river boulders

As I continue to self-learn UE4, I’m trying to develop a material for use on river boulders. I’m getting closer, but need a bit of advice. I want to place my boulder in a river, and then adjust the material so that the bottom of the boulder appears “wet” to a point slightly above the river surface.

After following along with about a thousand YouTube videos, I’ve gotten a bit closer, but I don’t think I’m quite on the right track. I would REALLY appreciate it if someone could offer me a bit of help (couched in terms understandable to an obvious newbie).

Thanks, in advance!

Forget world aligned and all o that. The boulders need to be positioned at any height - world aligning their texture makes little to no sense.

You want a system that let’s you adjust per-instance when needed. And globally when you don’t.

I would create a simple mask based on the object size.
You have Object Bounds which you can mask Z on. that should get you the height
You have Object Orientation - it may not matter, but you can use that to affect the water line based on object rotation with some math.

I’d have to try it hands on myself to concoct something with it, but the base idea is you mix the 2 parameters as the Alpha for a lerp.
Then you set the values of the lerp to be 0 for the dry part, and 1 for the wet part. And you just plug it into Specular.

You can also use a UV Mapped texture of the unwrapped rock (the lightmap UP is probably perfect for this) to manually paint the areas.

OR - maybe even better - you could use Vertex Paint to create the area where the water should be done on a per instance basis within the level as well. Sure, going in and painting them all is a time consuming thing.

I’d go with vertex painting.

Many thanks to both MostHost and RevOverDrive for their help and suggestions. It sounds like vertex painting would be the way to go…IF…this were an actual project. That’s good to know, and is much appreciated info.

In this case, however, I’m actually just trying to learn the scripting system (and to stay sane while self-isolating!). So, I’ve read MostHost’s post a bunch of times—it sounds like my simple project-for-learning is currently beyond my understanding of the scripting process. However, I’ll keep trying to chip away at it.

Thanks, again, for your help!