FHitResult has a lot of properties in it, one of them being the Actor it hit (landscape), but it can also return the the PhysicalMaterial associated with that actor.
TraceParams.bReturnPhysicalMaterial = true;
bool hitSomething = world->LineTraceTestByChannel(start, end, collisionChannel, TraceParams);
Assuming your trace is similar to the above, you can use the first line to make it also return the PhysicalMaterial
Then after you have your FHitResult, you can grab it like this:
//Cast it to your custom class
UMyPhysMat* PhysMat = Cast<UMyPhysMat>(hitResult.PhysMaterial.Get());
That will allow you to pick up your custom physics material now from anywhere!
Just make sure you put your physics material in the LayerInfo file for each paint. That’s what lets each paint have it’s own physics material, and thus, it’s own FLinearColor/whatever else you add in there.
Edit: Incase it wasn’t clear, you’d make multiple Physics materials with all the colors you want, apply those and paint them into the landscape, and your character will now pickup your custom physica material colors as he runs around.