Announcement

Collapse
No announcement yet.

Switching Materials on a mesh using Blueprints

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Switching Materials on a mesh using Blueprints

    Hello,

    I'm creating a Status Aliment system and I'm working on a status called Stone. This would change the character's material to a stone material and block their input for a brief period of time. The issue I'm having is switching between materials. With my current setup, it switches the material to the default grey material. Is there any way to make this happen correctly? I can't seem to find anything online about doing this and I kinda remember there being a content example with a constantly changing material, though I can't seem to find it.

    Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
    Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

    #2
    Originally posted by liondog View Post
    Hello,

    I'm creating a Status Aliment system and I'm working on a status called Stone. This would change the character's material to a stone material and block their input for a brief period of time. The issue I'm having is switching between materials. With my current setup, it switches the material to the default grey material. Is there any way to make this happen correctly? I can't seem to find anything online about doing this and I kinda remember there being a content example with a constantly changing material, though I can't seem to find it.
    This is what I did to change the material of the mesh at runtime,

    Click image for larger version

Name:	MaterialSwitching.PNG
Views:	1
Size:	145.0 KB
ID:	1084666

    Thanks,

    Comment


      #3
      Originally posted by Shantaram View Post
      This is what I did to change the material of the mesh at runtime,

      [ATTACH=CONFIG]54875[/ATTACH]

      Thanks,
      Thanks! Unfortunately this is just giving me the default material

      Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
      Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

      Comment


        #4
        Well is it possible for me to have this issue because I'm using the player character which has multiple materials on him? I see where you can choose by index, but still I'm wondering if this is even possible.

        Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
        Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

        Comment


          #5
          Originally posted by liondog View Post
          Well is it possible for me to have this issue because I'm using the player character which has multiple materials on him? I see where you can choose by index, but still I'm wondering if this is even possible.
          Yes, you can change the material by index. "Set Material" node has element index. Specify which index you want to change and maybe that can work.
          If that can't work, can you share your blueprint image?

          Thanks,

          Comment


            #6
            Originally posted by Shantaram View Post
            Yes, you can change the material by index. "Set Material" node has element index. Specify which index you want to change and maybe that can work.
            If that can't work, can you share your blueprint image?

            Thanks,
            Here it is. It's pretty much the same as the picture above, except I am getting the player character's material and I am attempting to change that. I would really actually like to make it change gradually, but If I can't get this working, I know for a fact a gradual change would be a lot harder or impossible.

            Click image for larger version

Name:	bandicam 2015-08-29 21-31-18-804.jpg
Views:	1
Size:	151.8 KB
ID:	1084695

            Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
            Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

            Comment


              #7
              Open your stone material and in that go to "Usage" section and check "Used with SkeletalMesh" option, that should fix it.

              Click image for larger version

Name:	MaterialSettings.PNG
Views:	1
Size:	8.5 KB
ID:	1084697

              Thanks,

              Comment


                #8
                Originally posted by Shantaram View Post
                Open your stone material and in that go to "Usage" section and check "Used with SkeletalMesh" option, that should fix it.

                [ATTACH=CONFIG]54935[/ATTACH]

                Thanks,

                Thanks so much! It worked! Wish I would have checked the material settings before I made this post! haha

                Coming 2016| Interested joining my team, email me: daniiartsstudio@gmail.com
                Official Thread! Unreal Forums Follow us on Facebook Watch development blog on Youtube

                Comment

                Working...
                X