Advertisement
Znimatorr

KillObject

May 27th, 2022
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class KillObject : MonoBehaviour
  6. {
  7.    
  8.     void Start()
  9.     {
  10.        
  11.     }
  12.    
  13.     private void OnTriggerEnter2D(Collider2D other) {
  14.         BirbController birb = other.gameObject.GetComponent<BirbController>();
  15.         if (birb != null)
  16.         {
  17.             birb.IsDead = true;
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement