C
C#15mo ago
Chengiz

❔ 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
Azrael
Azrael15mo ago
You should probably figure that out on your own, it's supposed to be a challenge right?
Chengiz
ChengizOP15mo ago
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?
Azrael
Azrael15mo ago
I don't know. I can't visualize the project. You have to send some actual code. $code.
MODiX
MODiX15mo ago
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/
Chengiz
ChengizOP15mo ago
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
Azrael
Azrael15mo ago
$code
MODiX
MODiX15mo ago
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/
Azrael
Azrael15mo ago
Oh yeah, this is Unity. Bye bye.
Chengiz
ChengizOP15mo ago
hmm?
Azrael
Azrael15mo ago
I've only worked with C++ DX11. I've never used Unity.
Chengiz
ChengizOP15mo ago
ooh i see, thanks anyways!
Moods
Moods15mo ago
$unity
Moods
Moods15mo ago
You can also ask in #game-dev
Azrael
Azrael15mo ago
Thanks for that command.
Chengiz
ChengizOP15mo ago
ty!
Accord
Accord15mo ago
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.
Want results from more Discord servers?
Add your server