Hey I Have been searching all Night, for something to help me and have tired about a million combinations and i cannot seem to get what i am looking for…

Please mind that i am also new to C#, but any help will be appreciated.

ugh alright I have a Script Player.cs.

using UnityEngine;
using System.Collections;
 
public class Player : MonoBehaviour
{
   
    public string username;
    public bool human;
    public Color userColor = new Color(1,1,1,1);
 
 
 
    // Use this for initialization
    void Start ()
    {
        PlayerColor();
    }
 
    //PlayerColor
    void PlayerColor()
    {
        Renderer rend = GetComponent<Renderer>();
        rend.material.shader = Shader.Find("PlayerColor");
        rend.material.SetColor("_Color", userColor);
        }
       
    }

This is before i run… you can see everything is assigned…
53181-beforeruntime.jpg
At Runtime the S_player Color Disappears…
53182-runtime.jpg
But if i drag it back on the material it is picking up the color that the player selected…

But Its Only Changing the Color that the material is assigned to if that material is on another Object it does not change it at all.

I found the fix

so sharedMaterial is used for everything using that material while material is just the game object applied to it?
thank you i can see it starts

Wow thanks Bud i found the problem with the shader…

here is the code that works…

using UnityEngine;
using System.Collections;
 
public class Player : MonoBehaviour
{
   
    public string username;
    public bool human;
    public Color userColor = new Color(1,1,1,1);
 
 
 
    // Use this for initialization
    void Start ()
    {
        PlayerColor();
    }
 
    //PlayerColor
    void PlayerColor()
    {
        Renderer rend = GetComponent<Renderer>();
        rend.sharedMaterial.shader = Shader.Find("Custom/S_PlayerColor"); // this is where the issue was had to add custom.
        rend.sharedMaterial.SetColor("_Color", userColor);
        }
       
    }