how to change material in script unity
public Material Material1;
//in the editor this is what you would set as the object you wan't to change
public Renderer Object;
void Start()
{
Object.material = Material1;
}
how to change material in script unity
public Material Material1;
//in the editor this is what you would set as the object you wan't to change
public Renderer Object;
void Start()
{
Object.material = Material1;
}
how to set material c unity
Renderer rend = GetComponent<Renderer>();
if (rend != null){
rend.material = newMaterialRef;
}
change physics material unity
coll = GetComponent<Collider>();
coll.material.dynamicFriction = dynFriction;
coll.material.staticFriction = statFriction;
change physics material unity
Collider coll = GetComponent<Collider>();
coll.material.dynamicFriction = dynFriction;
coll.material.staticFriction = statFriction;
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