- Home /
Question by
jordanenglish115 · Jan 06, 2021 at 07:18 PM ·
animationglitchmaterial color
Material turns blue when changing the emission color smoothly
When i select the material in the inspector it changes back to normal. The color intensity variable is changed by the animator. Here is the code i use:
private IEnumerator TransformShineToSuper()
{
if (shining)
{
StopCoroutine("TransformShineToSuper");
}
shining = true;
Material shineMaterial = new Material(normalMat);
normalRenderer.material = shineMaterial;
shineMaterial.EnableKeyword("_EMISSION");
while (shining)
{
shineMaterial.SetColor("_EmissionColor", Color.yellow * colorIntensity);
yield return null;
}
}
public void StopShining()
{
shining = false;
characterStats.ChangeModel(true);
playerAnimation.ChangeAnimForSuperForm(false);
normalRenderer.material = normalMat;
colorIntensity = -10;
}
Here is how the material should look like after StopShining():
Here is what's happening:
Update: You can apparently change the emission in the animator itself and when i did that it worked!
glitchedmat.png
(58.7 kB)
normalmat.png
(77.1 kB)
Comment
Your answer
Follow this Question
Related Questions
Animation with minimum length? 1 Answer
Climb animation is glitchy and isnt working properly 0 Answers
Model freaks out when animating 0 Answers
Player sprite is teleporting when certain animations are triggered. 0 Answers
animations repeating unwantedly 0 Answers