using System.Collections; using System.Collections.Generic; using UnityEngine; public class DamageZone : MonoBehaviour { public GameObject player; void Start() { player = GameObject.Find("Player"); } void OnTriggerStay(Collider other) { if (player.GetComponent().currentHealth > 0) { player.GetComponent().currentHealth -= 0.1f; } } }