private void OnTriggerEnter(Collider other) { if (godMode) { debugger.Info("god mode enabled, ignoring collision"); return; } switch (other.gameObject.tag) { case "Ghost": Ghost ghost = other.GetComponent <Ghost>(); if (ghost.IsRunningHome()) { return; } // Reset velocity to stop drifting away rb.velocity = Vector3.zero; ghost.GetComponent <Rigidbody>().velocity = Vector3.zero; if (ghost.IsEdible()) { ghost.RunHome(); audioManager.Play(SoundNames.EAT_GHOST); pacmanScore.AddScore(Constants.GHOST_EATEN_SCORE); } else { StartCoroutine(Die()); } break; } }