How to compare dynamic material to material

I have dynamic material and trying to check if it came from a material, but I can’t find a way to do it. Can someone help?

So I do this:

and later, I can say:

image

Already tried that and weirdly it doesn’t work, even checked that I am comparing the right materials in Debug, and because I am using instances like in your example even if it did work it be bad as I need to get MyMaterial_Instance from this and not MyMaterial as there can be other meshes that use MyMaterial_Instance2 or other material from the same parent.

Out of interest, why are you comparing these?

I am using Static Instance Meshes as walls for my ship and the fastest way to check if one block is one type is to check its material(or at least it what I thought), now that I think about it looks like I got tunneled visioned as I can just create a dictionary and find the needed Static Instance Mesh with an enum, so I guess my problem is solved thanks.

How are you doing btw? Wasn’t here for a long time I see that you are still helpful as ever.

Better idea. When I first started out, I was comparing materials to see if puzzles had been solved. Turned out a much easier way, was to compare intergers :slight_smile:

How are you doing btw? Wasn’t here for a long time I see that you are still helpful as ever.

Thanks :slight_smile: Doing ok. Working on the second game, but it’s gonna take a lot longer than the first… :disguised_face:

1 Like