Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Color submeshes

Discussion in 'Scripting' started by unity_user_12345, May 29, 2015.

  1. unity_user_12345

    unity_user_12345

    Joined:
    May 21, 2015
    Posts:
    14
    I have a mesh that has 10 submeshes, I wonder how I can change the color of of these submeshes to a different color (e.g submesh1 will have a red color, submesh2 will have a blue color,...etc). Any advise please?

    UPDATE:

    This is how I'm getting my mesh which has 10 submeshes:

    SkinnedMeshRenderer smr = gameobject1.GetComponent<SkinnedMeshRenderer>();
    Mesh main_mesh = smr.sharedMesh;
     
    Last edited: Jun 2, 2015
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. unity_user_12345

    unity_user_12345

    Joined:
    May 21, 2015
    Posts:
    14