Hello all!
After another week of banging my head against a wall, I thought I saw the light until…
I am trying to trigger switch of material according to a float variable (var_float) for a project of mine.
The constraint is that there are 5 materials to switch between depending on var_float.
I managed to set the logic for that.
But blending between one material to another proves more complex than I could imagine.
I thought I found a solution in using a Material Instance with Blend Layer as simple Alpha to switch between my 5 material Layers.
The idea is to use the Blend Layer scalar parameter for the alpha to display or not the texture if var_float is within a defined range.
That all works: in the Material Instance, I can toggle between 1 and 0 the scalar parameters of the 5 Blend Layers I have for my 5 Materials and they display the way I want.
But now comes the issue: var_float changes on minute basis, so evolves at runtime.
And I want the material to blend and change accordingly.
When I try to get my Blend Layers’ scalar parameters in the Level_BP to set them up with the Create Dynamic Material Instance, my material doesn’t update or change.
Though, I can ‘play’ the project and toggle the Blend Layers’ scalar parameters manually and see the change…
Likely, there is something that I am not properly connecting.
But I also worry, after reading a post from another person here who had a similar (unsolved) issue: can Blend Layer’s scalar parameters be changed at runtime?
If not, does anyone has a possible solution to achieve a blend between multiple materials?
Here is the logic for the display of my material depending on var_float:
mat_1 if var_float = in range (-7.5 to -4.5)
mat_2 if var_float = in range (-6.75 to -0.75)
mat_3 if var_float = in range (-3 to 3)
mat_4 if var_float = in range (0.75 to 6.75)
mat_5 if var_float = in range (4.5 to 7.5)
The scalar parameters from Blend Layers - that works just fine
Level_BP, setting up var_float to modify the Blend Layer’s Scalar parameters at runtime