Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class HitBullet : MonoBehaviour
- {
- int health = 100;
- // Update is called once per frame
- void Update()
- {
- }
- void OnTriggerEnter(Collider other)
- {
- Debug.Log("In OnCollisionEnter.");
- if(other.gameObject.tag == "Bullet")
- {
- health -= 10;
- Debug.Log("In if statement.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement