- Home /
Detect material by position on a mesh with multiple materials
Hi,
I imported into my project a mesh with multiple materials attached; This mesh represents a terrain and each material is for a different type of ground (ice, dirt, green).
I have a human character walking on this mesh, and I'd like to hear a different sound of footstep based on the type of ground the character is walking on.
Well, how can I trace the material my character is walking on? (without splitting the mesh in more parts, maintaining a unique mesh).

Answer by amitsri20 · Aug 29, 2020 at 07:27 AM
I faced the same challenge for one of my projects, could not find any solution to detect material at runtime.
I then decided to break the model into separate mesh based on Material. If you are using blender then it can be done simply (Edit Mode -> Press 'P' -> Separate by Material) and then assign specific tags to detect collision.
Hope it helps!
Your answer