Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            playerScript player = other.GetComponent <playerScript>();
            if (player != null)
            {
                player.damage();
            }

            CharacterController characterController = other.GetComponent <CharacterController>();
            if (characterController != null)
            {
                characterController.enabled = false;
            }
            other.transform.position = _respawnPoint.transform.position;

            StartCoroutine(characterControllerRoutine(characterController));
        }
    }