Making my walls disappear by touching the floor
i want that when my player touches the house's floor the walls disappear, i tried using this, can u help me? cuz i don't even know a lot about how tags works
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Disappear : MonoBehaviour
{
public MeshRenderer Wall1;
public MeshRenderer Wall2;
public MeshRenderer Wall3;
public MeshRenderer Wall4;
public MeshRenderer Wall5;
public MeshRenderer Wall6;
public MeshRenderer Wall7;
public GameObject Wall;
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
Wall1.enabled = false;
Wall1.enabled = false;
Wall1.enabled = false;
Wall1.enabled = false;
Wall1.enabled = false;
Wall1.enabled = false;
Wall1.enabled = false;
}
}
}
Comment