Hi guys,
I'm trying to do a quick material swap on my character at runtime.
It works for certain animations, but other animations it doesn't work. (Same rig, same spine skeletonanimator) So I don't think there is something wrong with the code.
I can see the material swapping in the inspector, but it swaps back to the original material almost instantly.
For example
Animation 1(works) - Swap material A with material B and back to material A after "x" time.
Animation 2(does not work) - Swap material A with material B, but instantly back to material A . I don't see material B at runtime.
public IEnumerator SwapMaterial()
{
_gameObj.GetComponent<Renderer>().material = _gameObjB.GetComponent<Renderer>().sharedMaterial;
yield return _delayHalfSec;
_gameObj.GetComponent<Renderer>().material = _gameObjA.GetComponent<Renderer>().sharedMaterial;
}
Also I notice that there's 2 materials on my skeletonanimator, but when I look at the atlas there's only 1 material.
Any help would be appreciated. :sweat: