UE5 Blueprint Tutorial - How to Create Dynamic Material Instances

Поділитися
Вставка
  • Опубліковано 12 сер 2023
  • Create Dynamic Material Instances in Blueprint! This video explains how to use Blueprint to change material qualities of Materials during runtime.
    ______________________________________________________________________________________________
    Want to support my channel and help me continue to create educational content for the gaming community?!
    Join my Patreon! --- / unrealdevhub
    ______________________________________________________________________________________________
    You can learn how to build games in UE5!!! Subscribe to Unreal Dev Hub for more UE5 Tutorials!
    As always, leave a comment and let me know if you found this video helpful, and what you want to learn about next!
  • Ігри

КОМЕНТАРІ • 48

  • @azrad
    @azrad 6 місяців тому +6

    As a person who also like hotkeys, you can press S, V instead of 1 or 3 and later converting to parameters. :)

    • @UnrealDevHub
      @UnrealDevHub  6 місяців тому +3

      Great call! I made an updated video (with some additional/different functionality) where I mention the hotkeys. Great callout - the 1 and 3 keys are my favorite hotkeys in the material editor, and B for Branch has to be my most used in the Blueprint Graph.
      A newer video I've posted tapping into some other functionality related to Dynamic Material Instances:
      ua-cam.com/video/7S8FdUPpxUw/v-deo.html&ab_channel=UnrealDevHub

    • @TheArtistEllie
      @TheArtistEllie 2 місяці тому

      And F click for foreach node - that's a good one.

    • @snookofficial7211
      @snookofficial7211 12 днів тому

      Another one that I don't see people using, is if you right click on the metalic or roughness pins, and select 'promote to a parameter' it will set up a named scaler parameter for you already wired in. This also works on most input pins, though sometimes it'll give you a vector 3 parameter when all you want is a scalar but it still saves time though!

  • @seanoskea7411
    @seanoskea7411 10 місяців тому +6

    From one underviewed content creator to another, good job. Just what I try to do, no nonsense, short, clear, useful.

    • @UnrealDevHub
      @UnrealDevHub  10 місяців тому +2

      Thank you, much appreciated! I started my journey in Unreal back in 2016 through resources on UA-cam, so just trying to return the favor now that I've been working in the gaming industry for a while.

    • @seanoskea7411
      @seanoskea7411 10 місяців тому +1

      @@UnrealDevHub Yeah, I make mine as supplements for my students and I'm not monetized. I don't expect to be the next Faucher or WINBUSH but when you spend all day making a 10 min video as good as you can get it, it would be nice to crack triple digits after a few months. Oh well.

  • @sammyrothman7664
    @sammyrothman7664 5 місяців тому +1

    This was a great tutorial. Thanks for the help!

  • @graemepalmer2306
    @graemepalmer2306 9 місяців тому +2

    Exactly what I needed, thanks!

    • @UnrealDevHub
      @UnrealDevHub  9 місяців тому

      Happy to hear that. If there are any other subjects or examples you’re interested in learning more about, let me know!

  • @alisonyellen6100
    @alisonyellen6100 11 місяців тому +2

    Super helpful! Thank you.

    • @UnrealDevHub
      @UnrealDevHub  11 місяців тому +1

      Glad you enjoyed the tutorial.

  • @SlashTheFlash
    @SlashTheFlash 6 місяців тому +1

    Thanks alot!!!!

  • @KaVQ666
    @KaVQ666 4 місяці тому +1

    Thanks a lot!!

  • @them3ta_93
    @them3ta_93 4 місяці тому

    you saved me, thanks

    • @UnrealDevHub
      @UnrealDevHub  4 місяці тому +1

      Happy the video was helpful.

  • @rifat.ahammed
    @rifat.ahammed 7 місяців тому +1

    Thanks

  • @nigusumekonnen9478
    @nigusumekonnen9478 6 місяців тому

    is it possible to control one of the parameters with a skeletal mesh bone? if there is a solution, please guide me .

  • @ChristopherFranko
    @ChristopherFranko 5 місяців тому

    cool video, you can use nvidia broadcast to eliminate all the sticky mouth sounds when recording.

    • @ChristopherFranko
      @ChristopherFranko 5 місяців тому

      also there is alot of vocal fry

    • @UnrealDevHub
      @UnrealDevHub  5 місяців тому

      Ironically this is the first tutorial I ever made - I got a new mic shortly after and that’s not an issue with all of my recent videos 😂

    • @ChristopherFranko
      @ChristopherFranko 5 місяців тому

      my brother :)@@UnrealDevHub

  • @Name88282
    @Name88282 3 місяці тому +1

    how do i make it viewable in the editor

  • @suke0408
    @suke0408 Місяць тому +1

    Great tutorial:)
    Is this only for game mode? I want to edit and see each parameter in Editor mode.

    • @UnrealDevHub
      @UnrealDevHub  Місяць тому +1

      You can just move this logic to the construction script and you’d see this change in viewport without hitting play!

    • @suke0408
      @suke0408 Місяць тому

      @@UnrealDevHub
      ahh, I see
      Thank you, I’ll try that!

  • @omg-the-best-crazy
    @omg-the-best-crazy 5 місяців тому

    Is it possible to do this in construction script?

  • @EleventhEwe67
    @EleventhEwe67 7 місяців тому +1

    Hello, great video. How can you change a material of an object and save it for the next map? Once I change levels the object's material is reseted to the default one.

    • @UnrealDevHub
      @UnrealDevHub  7 місяців тому

      So what you want is a Material Instance. This will use all of the Parameters you've created in the material in a way that you can permanently set the values of materials that use all of the same logic as your parent material.
      ua-cam.com/video/wUfGPIB01yU/v-deo.html&ab_channel=UnrealDevHub
      In this ^ video I cover this process of creating a Material Instance at 4:25. You just right click your material, select the first option (Create Material Instance) and then in that material instance you can adjust the material parameters in a way that is permanent. Then apply that material to your mesh.

    • @EleventhEwe67
      @EleventhEwe67 7 місяців тому

      @@UnrealDevHub that's awesome! I'll check it out, thanks!

    • @EleventhEwe67
      @EleventhEwe67 7 місяців тому

      So the thing is, I'm making a ball game. I already have a save and load system and I have a store in which the player can buy and change the ball skin. I don't know what I'm doing wrong, but I've tried to save the new material for the next map and load it, but it still shows the default one. In the debugs it shows that its using the new material, but the new material isn't loaded into the next phase/map. Do you know how can I do this?@@UnrealDevHub

    • @UnrealDevHub
      @UnrealDevHub  7 місяців тому +1

      @EleventhEwe67 Hmmm. So it sounds like you're saying you have the material stored somewhere after you've purchased it in the in-game UI. - Do you have your actor SetMaterial with your new purchased material (skin) on BeginPlay? It might be saved somewhere, such as in a variable MyPurchasedMaterial, but even after you've saved it, you'd want to set MyPurchasedMaterial to MyBall (ball mesh component) on BeginPlay when you spawn the MyBall actor. When you spawn the actor in each new level, it is creating a new version of the Actor (pawn) with its default values.
      When you spawn your actor, make sure that you set the new material - totally speculation, but from what your describing, that could be a solve.

    • @EleventhEwe67
      @EleventhEwe67 7 місяців тому +1

      @@UnrealDevHub You nailed it! I was able to save the material and load it, I just redid the code in the beginplay of each phase and it worked. Thanks!

  • @pbm000
    @pbm000 2 місяці тому

    What do you do at 2:38 to enable Event BeginPlay?
    It's disabled for me too and I don't know why.😢😅

    • @pbm000
      @pbm000 2 місяці тому

      I solved it.
      I just had to connect the event to something.😅
      I still wonder what you did.

  • @zeon3d755
    @zeon3d755 Місяць тому +1

    Can you show how to use CanvasRenderTarget2D to write on them?

    • @UnrealDevHub
      @UnrealDevHub  Місяць тому

      When you say "write on them" do you mean how to use the mouse to draw on a texture that would be displayed in the world? @zeon3d755

    • @zeon3d755
      @zeon3d755 Місяць тому

      @@UnrealDevHub no to place dynamic text

  • @Dhieen
    @Dhieen 3 місяці тому +1

    Nice, how do you see the result outside of the play mode? in the editor

    • @snookofficial7211
      @snookofficial7211 12 днів тому

      Damn, that's what I'd like to know but no reply from youtuber.

  • @robotjellyfish3209
    @robotjellyfish3209 26 днів тому

    why is it so hard to get this to work with a decal

    • @UnrealDevHub
      @UnrealDevHub  25 днів тому

      In theory it should be the same - make sure that your material parameters are named correctly in your construction / BeginPlay script. Also make sure that you've made them Material Parameters by right clicking and selecting the option in the material graph.
      It should behave identically for all types of materials - opaque, translucent, masked, decal, etc!

    • @robotjellyfish3209
      @robotjellyfish3209 24 дні тому +1

      @@UnrealDevHub thanks for replying, appreciate it. i will take a closer look. i did this once but i found its so finiky to get working.cheers

  • @asim.6877
    @asim.6877 26 днів тому +1

    I appreciate the tutorial but sprinting through blueprints without explaining the steps make it impossible to follow. This is not a beginners tutorial at all.

    • @UnrealDevHub
      @UnrealDevHub  25 днів тому +1

      I haven’t actually gotten that feedback on this particular video before. Take a look at my “beginner series” on my channel - it might be a little more “wordy” and easier to follow along if you’re new to UE5!