Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / Puzzles / Barrier.cs
@Rackday Rackday on 21 Aug 2024 455 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Barrier : MonoBehaviour
  5. {
  6. private PlayerController player;
  7. private void Start()
  8. {
  9. player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
  10. }
  11. private void OnCollisionEnter(Collision collision)
  12. {
  13. if(collision.gameObject.tag == "Box")
  14. {
  15. Destroy(gameObject);
  16. }
  17. }
  18. }