Text wont be covered
Hello. am new to unity, and trying to make a game. In the game, there are some cubes that have text on them and should be covered until a collision happens with another object. but whatever I do, the text won't be covered. any object I put over the text becomes transparent. How can i fix that
Answer by Pathojen · Dec 07, 2021 at 07:31 AM
Could you, by any chance, just turn the text off and on? (Pardon the weird formatting, I was trying to fix the code in this answer window.)
For instance
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TurnOff : MonoBehaviour
{
public GameObject text;
void Start()
{
text.setActive(false);
}
void OnCollisionEnter(Collision collision)
{
text.SetActive(true);
}
}
That would change the whole code, the game has too much calculations already in it, but i will try. thanks
Your answer
Follow this Question
Related Questions
Hide (not delete) text after given time..? 1 Answer
Text font and bold tag issue 0 Answers
Dynamically added UI text is not displaying 2 Answers
TextMeshPro Set Alpha Color 0 Answers
PlayerPrefs and Text not working but no errors are given. 1 Answer