using UnityEngine; using System.Collections; public class BaseGroundScript : MonoBehaviour { void OnTriggerEnter2D(Collider2D other) { var player = other.gameObject.GetComponentInParent(); if(player!= null) player.TakeDamage(100f); } }