❔ GMT (The Unity Tutorial For Complete Beginners) help
Its a tutorial on YT where you mike a FlappyBird copy, after completing it i want to make the pipes stop spawning when i get a collision and get Game Over, cant figure how to do it. Any help?
17 Replies
You should probably figure that out on your own, it's supposed to be a challenge right?
hmm i agree, have thought about it all day since im very nice to coding, i think i figured it out just now but not sure if i did it right at all? I made a public GameObject in my UI manager and connected that to the pipe object and in my GameOver function and i .SetActive as false when i get game over after collision. Can i do that?
I don't know.
I can't visualize the project.
You have to send some actual code.
$code.
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class InfoManager : MonoBehaviour
{
public int playerScore;
public Text highScore;
public GameObject gameOverScreen;
public GameObject stopPiping;
public void addScore(int scoreToAdd) { playerScore = playerScore + scoreToAdd; highScore.text = playerScore.ToString(); } public void restartGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } public void gameOver() { gameOverScreen.SetActive(true); stopPiping.SetActive(false); } stopPiping is my pipeSpawner
public void addScore(int scoreToAdd) { playerScore = playerScore + scoreToAdd; highScore.text = playerScore.ToString(); } public void restartGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } public void gameOver() { gameOverScreen.SetActive(true); stopPiping.SetActive(false); } stopPiping is my pipeSpawner
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/Oh yeah, this is Unity.
Bye bye.
hmm?
I've only worked with C++ DX11.
I've never used Unity.
ooh i see, thanks anyways!
$unity
You can also ask in #game-dev
Thanks for that command.
ty!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.