I created an object whose mesh renderer is disabled, I want it to be Enabled when mouse goes on it and disable when mouse goes out, can you help me pls ?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeactivateScript : MonoBehaviour
{
public GameObject PLS ;(
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeactivateScript : MonoBehaviour
{
public MeshRenderer PLS;
void OnMouseEnter()
{
PLS.enabled=true;
}
void OnMouseExit()
{
PLS.enabled=false;
}
void OnMouseOver()
{
}
}
Thx for the basic information of the MeshRenderer because now I can just change the MeshRenderer into BoxCollider and have a moving/disapearing door that I can put in my level