Skip to main content
New Participant
Oct 7, 2024 1:38 PM UTC

MRUK - Unity - assigning two materials to global mesh

Hi,

I would like to assign two materials to the global mesh. Unfortunately, Effect Mesh allows to assign one only.

Is there a way to do it via code in Unity? 

Anyone willing to point me in the right direction? Newbie here 😥

Carlo

2 replies

Inspiring
Oct 16, 2024 7:25 AM UTC

you can access the mesh renderer via script and you can replace the material during runtime.

gameobject.GetComponent<Renderer>().material = myMaterial

 

New Participant
Oct 16, 2024 1:04 PM UTC

Sounds great magnimus_studios 

Do you think I can assign two materials?