Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PlayerHurt : MonoBehaviour {
- public int damage; //Damage the player will receive when enter the trigger
- private void OnTriggerEnter(Collider other) {
- if (other.gameObject.CompareTag("Player")) {
- other.GetComponent<PlayerHealth>().hurt(damage);
- }
- }
- }
Add Comment
Please, Sign In to add comment