private void OnTriggerEnter(Collider other) { AmeliaStats player = other.GetComponent <AmeliaStats>(); if (player != null) { player.ItemCollect(gameObject); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { AmeliaStats player = other.GetComponent <AmeliaStats>(); if (player != null) { print("Hit Player!!!!"); player.TakeDamage(1); } }
private void OnTriggerEnter(Collider other) { AmeliaStats player = other.GetComponent <AmeliaStats>(); if (player != null) { //add key to inventroy player.ItemCollect(gameObject); //remove key from world gameObject.SetActive(false); } }
private void OnTriggerEnter(Collider other) { AmeliaStats player = other.GetComponent <AmeliaStats>(); if (player != null) { print("Hit Player!!!!"); player.TakeDamage(1); Destroy(gameObject); return; } Destructable target = other.GetComponent <Destructable>(); print("Hit something:" + target.name); if (target != null) { target.TakeDamage(1f); Destroy(gameObject); } }