Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class doorcontroller : MonoBehaviour {
  6. GameObject Door;
  7. GameObject Button;
  8. bool pressed;
  9. // Use this for initialization
  10. void Start () {
  11. pressed = false;
  12. }
  13.  
  14. // Update is called once per frame
  15. void OnTriggerStay(Collider Button) {
  16. pressed = true;
  17. }
  18.  
  19. public void Update()
  20. {
  21. if (pressed){
  22. Object.Destroy(Door);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement