In my prototype, I’m trying to script an elevator, (of maybe twenty vertices at most), to go up via animation. While the animation is playing though, the frame rate drops like an anvil in Dragonball Z training gravity. The scene is highly simple, (it’s all cubes).
if(elevator)
{
// Makes player imobile and follow elevator.
playerMove = GameObject.FindWithTag ("player").GetComponent<cube_move>();
playerMove.enabled = false;
playerMove.gameObject.transform.parent = platform.transform;
//plays animation
models.animation.Play(step1);
yield return new WaitForSeconds(3.2f);
if(step2 != "none")
{
models.animation.Play(step2);
yield return new WaitForSeconds(2.5f);
}
//Lets player move again.
playerMove.gameObject.transform.parent = null;
playerMove.enabled = true;