How would I do this? I’m trying to get a door to disappear after 3 minutes, on a timer, and I’m unsure how to do this in C#! I know I should be making a true/false statement and if/then but I’m hesitant on its formulation. Thank you for all the help!
Call Destroy(gameObject, 180) in the Start() of your door script.
That was immensely helpful, @GroZZleR ! I am wondering now if the procedure for enabling mesh renderer of an object would be similar? I’m working with this code and would like the collision to create or reveal a blockage behind the player (so that they cannot go back).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangeBox : MonoBehaviour {
public Material Space_Nebula_DeepBlack;
void OnTriggerEnter (Collider other) {
if (other.gameObject.tag == “Player”) {
RenderSettings.skybox = Space_Nebula_DeepBlack;
Destroy(this);
}
}