Download

UMG Slider won´t upate Instanced Material values in a meshes

Hello everyone,
I´m reaching to the community to please help me solve a problem I can´t work out. It should be a simple thing really…
I´m using the VehicleTemplate to ilustrate the following: I´d like increase/decrease a material´s instance value via UMG slider(say to emulate snow on a road or wetness on buildings). Now WHILE I CAN update/control the sedan´s color via silder I cannot do the same with any of the two actors in the scene :expressionless:
(please see pic 1) File sharing and storage made simple

1 - I have a Sedan (a skeletalMesh Vehicle), a building called HistoricPawn (Pawn class) and an building actor class called HistoricActor.

2 - I´m using a ConstructionScript in the SEDAN+other two buildings to create a Dynamic MaterialInstance and than promote it to a Var to store it´s value
File sharing and storage made simple

Buildings are set up the same way: File sharing and storage made simple

In the UMG Grapgh OnValueChanged I SET that value in a Float(valueslider) than Get it to drive the SetScalarParameter Value nodes (with the relevant parameter names)
File sharing and storage made simple

2.1 The material´s values are driven by a Parameter (called ChangeMaterial) going into a Lerp node; The value in controlled by the UMG slider Float (called ValorSlider);
File sharing and storage made simple
File sharing and storage made simple
Proof of concept Building MatINstance working: File sharing and storage made simple

3 - The casting to HistoricPawn compiles but always fails so it never talks to that mesh. I suspect that it has to do with type of object casting I´m using for both buildings; *please refer to UMG_Slider_Settings.png link above * , and cast to HistoricActor doesn´t accept any other type of object (GetController, etc…)
3.1 - Both buildings are Bprints actor/pawn respectively;

So what Am I missing in order to be able to change the building´s colors? :frowning: is there any other way to get the slider to “talk” the meshes and their InstMaterials?
Could someone please help me put with this one? cause it seems simple but for the life of me can make work! Thanks in advance.
I´m including a download link to the project for anymone who whishes to take a closer look: http://www.mediafire.com/download/6bbub0q35t4k4tn/Car_MatInstance.rar

Ok, so you have a pawn by class Sedan and one by class HistoricPawn. Is the parent class for one the other? For example, you might have sedan, then save sedan with more info in historic pawn. To do this, historicPawn would have to be a child of sedan. You can set the parent class in the blueprint settings.

Anyway, the playerPawn is by sedan and Sedan is not historicPawn and that is why it is failing.

Ciao James94Hodges and thanks for replying :slight_smile:

No, the HistoricPawn (which is a building mesh in the level) is not a child of Sedan. I just whish I knew what is the appropriate “object” in the Cast to HistoricPawn node was so it would not fail all the time :expressionless:
Maybe you could download the project and take a quick look per favore? :slight_smile:

@ James94Hodges
Forgot to clear this up I come from UDK so I´m at home with Kismet but BPs are really foreign in some ways…

My goal is to change regular Instanced Materials of environmental/decorative meshes in a level, SO I have NO idea whether they should be of a particular class (pawn or actor or other) and what that class should be in order to use the *Cast to *node.
In UDK they can be Actors and not really Pawns(which makes total sense) and all works out well, but In BPs…
In other words when I create a Blueprint for my buldings I´ve use Actors but nothing works, so I´m not really sure which class to use …
There ! I´ve completely humiliated myself before the community …:slight_smile:

Ok, I was going to type this out but I’ll do one better, send me the file and I’ll do a tutorial on how to make this function. Just a couple questions. Do you want to only change the one actor you are standing at while playing or do you want to change all the buildings together? I also assume you want to do this for several different type of meshes with different materials? Are you looking at only changing/updating a scalar parameter?

Thank you so much James94Hodges!
I´ve send you a PM with the link

About your questions:

Do you want to only change the one actor you are standing at while playing ?
If you mean the SedanVehicle character, No, I do not to change it.
If you refer to the ground the player character is standing on: yes, I do want o change the gound (although I´ve not made any BPs or built anything to achieve that in the project file in the link above - just to be clear on this)

I WOULD like to change/update a scalar parameter and Yes I would like to do this for different type of meshes w/ different materials.
If you have any trouble downloading it let me know! Again grazie mille for your time in helping me :slight_smile:

Still uploading the video here: https://youtu.be/4rFVaAemK7o Youtube is acting up. Hopefully the video will be up in the next hour.

Thanks a billion, no thanks a trillion James Hodges!!! :o I´ve skimed through the vid and can ´t wait to get started! Thanks for going out of your way to make a tut on this subject, I truly appreciate what you´ve done! I also loved that beautyfull little voice in background at 18:21 :slight_smile: God bless him/her (I ´ve got a little girl of mine own).
Again thanks for helping out a stranger, and if you´re ever in Portugal (in the Oporto Area) PM me I´ll show around :slight_smile:
Take care,
Marco

@James94Hodges: as a result of your tutorial I´ve been playing with sliders in umg and works just greaT :slight_smile:
However I was wondering whether it would be possible to have one slider to control all actors (or a certain group of actors) in the level
sort of “one slider to rule them all” :wink: kind of thing. Why?
1 - I´d like to have a main menu where I could control that sort of option…say …let´s inscrease the amount of wetness in a material in all actors that use it.
2 - Let´s say the one has a road made out of several segments/parts, it would be a bit unpractical to have widgets on each and every one of them, so you ´ve to slide each and every one as you went down that road.

So in UMG could you please explain how to have 1 slider anchored to a certain spot that controls more that one actor or scalar param materials?
Thanks