unity set material color
//Gets the renderer material and sets color
object.GetComponent<Renderer>().material.color = newColor;
unity set material color
//Gets the renderer material and sets color
object.GetComponent<Renderer>().material.color = newColor;
change olour in unity script
SpriteRenderer sr;
void Start()
{
sr = GetComponent<SpriteRenderer>();
}
void Update()
{
//This is a simple way of adding color
sr.color = Color.red;
//This is a more specific way of adding color
sr.color = new Color(0/*Red*/,0/*Green*/,0/*Blue*/)
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us