- Home /
Unable to show gameobjects at specific timing
Hi there. I am trying to make a script to set a button to show up after a specific event during game play.
When the game is playing, at the end of a level, there is a progress bar that shows up called Target Is Reached.
I am trying to add a button to a game pad after the Target Is Reached has been called. The button is called: SkipLevelBtn (Skip Level Button).
The following is the script that I have put together to show the gameobject, but it seems not to be working.
using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Linq; using Berry.Utils; using UnityEngine.UI;
public class SkipLevelBtnScript : MonoBehaviour { public static SkipLevelBtnScript main;
public GameObject TargetIsReached;
public GameObject SkipLevelBtn;
//IEnumerator SkipBtnShow()
public void SkipBtnShow()
{
if (TargetIsReached == true) {
SkipLevelBtn.SetActive (true);
}
}
}
Your answer
Follow this Question
Related Questions
Unity ads , can't we show video by clicking a button? 1 Answer
Destroy a Gameobject with a UI Button 3 Answers
How would I attached a gameobject to a prefab that is spawned at a specific time? 1 Answer
Can anyone help me in Bolt 0 Answers
GameObject.Destroy(gameObject) does not destroy capsules 2 Answers