Question by
AugustInSitu · Jun 25, 2016 at 08:03 AM ·
animationshaderstransitionmesh renderer
Mesh Renderer won't animate
Hi, I am attempting to animate a transition using a mesh renderer, and cannot get it to work... I can't seem to find any resources online that relate to this. Any help would be greatly appreciated!
///
Here is my code for the transition (using C#):
using UnityEngine;
using System.Collections;
public class BattleTransition : MonoBehaviour {
Animator anim;
bool isTransitioning = false;
public Renderer battleTransitionRenderer;
void Start () {
anim = GetComponent<Animator>();
battleTransitionRenderer = GetComponent<Renderer>();
StartCoroutine(BattleTransitionFromWorld());
}
public IEnumerator BattleTransitionFromWorld()
{
isTransitioning = true;
anim.SetTrigger("BattleTransition1");
while (isTransitioning)
yield return null;
}
void AnimationComplete()
{
isTransitioning = false;
}
}
When in Play mode, the animator shows the animation playing, but the image never does. So I assume the code works but hey what do I know.
///
Here is an image of the Inspector for the game object in question:
bt.png
(56.9 kB)
Comment