Cleaned up the PlayAnimation method.