This is a quick brief of defining physical materials in the MNSI plugin. It is not exhaustive, please look at the in depth pages for each topic mentioned to gain better understanding.
MNSI works on Physical Materials. Meshes loaded in blueprints actors that have the MNSI component must use a material that has a set Physical Material.
Example; MyProp is a blueprint actor that has a static mesh component and the MNSI component. The static mesh uses a material with MyPhysicalMaterial set as its physical material. Each time the static mesh actor sends out a collision event, the MNSI plugin will look at what physical material is it using to determine the sound.
The supplied starting physical materials that have sounds assigned to them are located in MNSI-MainPlugin/MNSI-PhysicalMaterials. To create a custom physical material with custom sounds, see below.
Quick Run - Defining your own physical material;
- Create a new Physical Material.
- Give it a unique name, in this case "ReallyCoolWood". Note. Do not use dashes "-" in the unique name. Dashes tell the plugin that the physical material is an "instance". Example; ReallyCoolWood, ReallyCoolWood-HighFriction, ReallyCoolWood-NoFallDamage, ReallyCoolWood-Slip and ReallyCoolWood-LiterallyWhatever will all play the sounds associated "ReallyCoolWood"
- Go to MNSI-MainPlugin/MNSI-BasicSoundSet. There are two structs there. A Blank ((MyCustomSoundSet)), and the DefaultSoundSet structs. Lets add the new physical materal to the MyCustomSoundSet struct. It doesn't matter where it is added, but for clarity, it is easier to start learning this using the blank MyCustomSoundSet struct.
- Open MyCustomSoundSet and will look like this.
The area of interest here are the Default Values. This is where all physical materials are written down for MNSI to look them up.
- "Impact_Hard_Sounds" is where Hard impact sounds are added.
- "Impact_Soft_Sounds" is where Soft impact sounds are added.
- "Friction_Roll_Sounds" is where looping sounds for rolling are added.
- "Friction_Linear_Sounds" is where looping sounds for sliding are added.
You will notice that each field is pre-filled with "DoNotLeaveTheseBlank-WillCrash". This is to fix a bug where trying to load an empty struct in a blueprint can cause the editor to crash.
- Time to add ReallyCoolWood to the struct. It should look like this.
Keys are added in the form of "The Name Of Physical Material" followed by either the name of another physical material, Or, the tag "DEFINT" which means; "Default to this sound for all sounds if no specific physical material is defined."
The two physical materials or the DEFINT tag are separated by the token distinction string "-". In this case, the final key looks like this. "ReallyCoolWood-DEFINT". This means that whenever MNSI sees a collision event, from a prop that has a material with the ReallyCoolWood physical material, it will play the sound defined for either the physical material key pair, or if none are found, the DEFINT sounds.
The actual sounds are Sound Cues.