Example #1
0
    void OnTriggerEnter(Collider other)
    {
        PlatformerPhysics physics = other.gameObject.GetComponent <PlatformerPhysics>();

        if (physics)
        {
            //set new respawn point
            physics.SetRespawnPoint(transform.position);
        }
    }
Example #2
0
    void OnTriggerEnter(Collider other)
    {
        player = GameObject.FindGameObjectWithTag("Player");
        PlatformerPhysics physics = other.gameObject.GetComponent <PlatformerPhysics>();

        if (other.gameObject == player)
        {
            //set new respawn point
            physics.SetRespawnPoint(transform.position);
            // Destroy this gameobject
            Destroy(gameObject);
        }
    }