- Home /
countdown timer on for example a wall of a building in your game?
Hi, How do you make a countdown timer on for example a wall of a building in your game?
Hey Savra. Just following up, Have you gotten your timer working? If so could you flag any answers that helped you as the correct answer so that others will more easily find them if they run into the same question?
Answer by Memige · Jun 07, 2013 at 08:35 PM
By on the wall, do you mean attached to the wall object, or graphically displaying on the wall in-game? Your wording seems to indicate the latter, in which case a I'd recommend looking into 3D Text
$$anonymous$$ight have been a bit unclear. Yes i want a countdown to be displayed on a wall in-game.
Then yes, definately have a look at the link I posted. Once you understand how to create 3D Text, it's as simple as positioning the gameObject in your scene :)
Oh, and for an example of making a variable countdown, check out $$anonymous$$i$$anonymous$$o51's answer in This Thread. It's the one with a bunch of up votes (not the green one that was flagged as the answer)
Answer by Seizure · Jun 07, 2013 at 08:29 PM
Theres a couple of different ways to do this but I would suggest using: (Below code is C#)
public bool destroyWallBool; //This defaults to false
public GameObject wall;
void Start()
{
startCoroutine(countDown());
}
void Update()
{
if (destroyWall)
{
destroy(wall);//Or whatever it is you wanted to do with wall
}
}
IEnumerator countDown()
{
yield return new waitForSeconds(20);
destroyWallBool = true;
}
`
I might have been a bit unclear. Yes i want to display a countdown on a wall in-game.
Your answer
Follow this Question
Related Questions
How to reset Time.time ? 1 Answer
advanced countdown timer help please 0 Answers
Timer script running too fast 1 Answer
How to use the same script on different objects at the same time? 1 Answer
Start timer on button press 1 Answer