Example #1
0
    public void RespawnAtCheckpoint(Collider collider)
    {
        deathCount++;
        logger.LogPlayerDeath(transform.position, collider.gameObject.name, deathCount, GameObject.Find("Game").GetComponent <AssignController>().controllerNum);

        sfx.playPlayerDeath();

        GetComponent <Movement>().LockMovement();

        TrapScript trap       = collider.gameObject.GetComponent <TrapScript>();
        GameObject checkpoint = trap.checkpoint;

        death.PlayAnimation();
        GameObject.Find("PlayerDeathParticles").GetComponent <ParticleSystem>().Play();
        respawnRequest  = true;
        respawnLocation = checkpoint.transform.position;

        Handheld.Vibrate();
    }