How to add multiple physics materials to static mesh which uses a single material

assume the following scenario: I have a static mesh with ONE material. However the object represented by this mesh and material is build from several materials in the “real world”. Let’s say the static mesh is a table, built from a wooden plate, concrete legs and a frame made of metal. Keep in mind, that the whole table uses only ONE material for visuals. Now if i wanted to create e.g. bullet impacts according to those materials i would need to use physics materials for the respective parts of the table. Now since i only have one material applied i can not use that in order to achieve that. My thought was to create simple collision primitives (plate, legs, frame) and apply a different physics material to each of those collision primitives. However this does not seem to be possible in Unreal. Or is it? Please keep in mind that it is no option to seperate the already present material into several single materials (wood, metal, legs) as the assets are already done.
In Unity i could simply assign a unique physics material to each collision primitive and i can hardly believe that Unreal does not offer that functionality to me.
So i’d be happy for any advice on this.

1 Like

You could make the collision yourself and manage it however you see fit…
remove the collision from the mesh, create a bluprint with the mesh, add in collision boxes that you type as needed.

Another method would be to try and read the color from the impact point of the texture.
then you just do range approximations on what was hit based on its color.

Likewise, you could assign an extra texture for the check to the item via a gameplay tag or something similar that is everywhere and works with instances.
then the impact logic can check if the tag is present, and use that simplified texture plus the UV to determine the material you hit.

for the UV info

To potentially read a pixel.…xel/index.html

It would run faster if set up a range of values mapped to a specific result via a data table.
However you would need to develop some sort of tool that puts the info into a data table you can read the result of at runtime.

It’s not overly complicated since the range is always 0 to 1 for a lightmap, and each part of the item will always be on a lightmap. However the numerical data representation with at least 100 numbers per side (1/100 precision of uv) which is therefore 100x100 data entries is a lot of data to keep for each item.
I would look into ways to compress it by removing the entries and defining area ranges instead.
the problem with that is that you may have to loop through a whole table anyway.

I still think that even with 100 materials the result would be faster then a pixel read, but thats conjecture without actually doing it.

Ps: thank you for a new plugin idea :0

Oh, btw, I don’t know when this was added in but it appears that since at least .25 each material has an array with up to 8 physical material maps.

This is a screenshot of the material.

It probably works similar to what I described.
The mask and the default material can be set in the Physical Material section. I assume if you setup a mask you can then paint the areas into it using HEX color codes to get the possible base value mixes (FF0000 - red, 00FF00 - green, so on).

Pretty dope to find exactly what I pictured already implemented :stuck_out_tongue:


Hey, thx for getting back to me! And yes, pretty dope to see that being implemented :slight_smile: