Answer the question
In order to leave comments, you need to log in
Why does the object disappear?
Does an object disappear when changing color through code?
using UnityEngine;
using UnityEngine.UI;
public class Oneclicers : MonoBehaviour {
public Color nostandrt;
public GameObject knopka_kup;
public GameObject text_kup;
private void Update()
{
knopka_kup.GetComponent().color = nostandrt;
text_kup.GetComponent().color = nostandrt;
}
}
Answer the question
In order to leave comments, you need to log in
GetComponent and other code, insert the code with the tag) so that it does not eat up characters))
and so corny you can have a color with Alpha 0 - that is, completely transparent.
and the shader on the object maintains transparency and makes the .
and judging by the code using UnityEngine.UI; you just have a canvas interface and all that, just with transparency support.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question