Hello group, newbie here.
I’m trying to make an object disappear with the mouse button down and reappear when the mouse button is up to make it reappear
using UnityEngine;
public class TestKD : MonoBehaviour
{
void Update()
{
if (Input.GetMouseButtonDown(0))
{
this.gameObject.active = false;
}
if (Input.GetMouseButtonUp(0))
{
this.gameObject.active = true;
}
}
}
It’s only working for the first part. The second part “true” is not reappearing. It also says the code is obsolete, but it puts me errors when it try GameObject.SetActive().
Any help would be very welcome.
thanks
Seb