using UnityEngine;
using System.Collections;
public class MainMenu : MonoBehaviour
{
public Transform EnemyManager;
public Transform Player;
Animator anim;
public void startgame()
{
anim.SetTrigger("GameStart");
EnemyManager.gameObject.SetActive(true);
Player.gameObject.SetActive(true);
}
}
I'm trying to make a start button for a game. I want the start button to run this script but every time I press start the game freezes and I get this error. I looked all night and can't figure out how to solve it.