- Home /
Get Material of Normal?
Hi, I'm trying to grab the material from a normal, and then I am trying to check if it is part of an array.
Comment
if(globalraycasthit.transform.gameObject.renderer.material==Ceramic$$anonymous$$aterials[0])
{
Debug.DrawRay(globalray.origin,globalraycasthit.point, Color.red, 5, true);
EffectToInstantiate = ParticleEffectList[0];
Instantiate(EffectToInstantiate, globalraycasthit.point + (globalraycasthit.normal * 0.1f), Quaternion.LookRotation(globalraycasthit.normal));
EffectToInstantiate = BloodEffectList[0];
Instantiate(EffectToInstantiate, globalraycasthit.point + (globalraycasthit.normal * 0.008f), Quaternion.LookRotation(globalraycasthit.normal));
//CreateParticle();
}
Right now I can't seem to figure out how to grab a material from a mesh face, the code now does nothing.
Updated:
if(globalraycasthit.transform.gameObject.renderer.shared$$anonymous$$aterial==Ceramic$$anonymous$$aterials[0])
{
Debug.DrawRay(globalray.origin,globalraycasthit.point, Color.red, 5, true);
EffectToInstantiate = ParticleEffectList[0];
Instantiate(EffectToInstantiate, globalraycasthit.point + (globalraycasthit.normal * 0.1f), Quaternion.LookRotation(globalraycasthit.normal));
EffectToInstantiate = BloodEffectList[0];
Instantiate(EffectToInstantiate, globalraycasthit.point + (globalraycasthit.normal * 0.008f), Quaternion.LookRotation(globalraycasthit.normal));
//CreateParticle();
}
I'm also trying to figure out how to say "If they're in this array".