// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { rb = animator.GetComponent <Rigidbody2D>(); boss = animator.GetComponent <BossBehaviour>(); rb.constraints = RigidbodyConstraints2D.FreezeAll; rb.simulated = false; boss.inHeal = true; boss.SpawnAntennas(); protectionOrb = Instantiate(boss.protectionOrbPrefab, boss.transform.position + new Vector3(0, 1.5f, 0), boss.transform.rotation); }