Quantcast
Channel: Answers for "Set GUI Text active/inactive by clicking on a button?"
Viewing all articles
Browse latest Browse all 4

Answer by KujaEx

$
0
0
Okay, I watched now this tutorial: https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button And made it that way with that script: using UnityEngine; using System.Collections; public class Help : MonoBehaviour { public GameObject startHelpText; void Start() { startHelpText.SetActive(false); } public void switchHelp(GameObject helpText) { if(helpText.activeSelf) { helpText.SetActive(false); } else { helpText.SetActive(true); } } } I put that Script on an empty object and put that object on the "On Click ()" thing in the button and choose the "switchHelp(GameObject helpText) " in there. It's working now... but I thought it could be easier...

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>