C
C#10mo 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
Azrael10mo ago
You should probably figure that out on your own, it's supposed to be a challenge right?
Chengiz
Chengiz10mo 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
Azrael10mo ago
I don't know. I can't visualize the project. You have to send some actual code. $code.
MODiX
MODiX10mo 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
Chengiz10mo 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
Azrael10mo ago
$code
MODiX
MODiX10mo 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
Azrael10mo ago
Oh yeah, this is Unity. Bye bye.
Chengiz
Chengiz10mo ago
hmm?
Azrael
Azrael10mo ago
I've only worked with C++ DX11. I've never used Unity.
Chengiz
Chengiz10mo ago
ooh i see, thanks anyways!
Moods
Moods10mo ago
$unity
Moods
Moods10mo ago
You can also ask in #game-dev
Azrael
Azrael10mo ago
Thanks for that command.
Chengiz
Chengiz10mo ago
ty!
Accord
Accord10mo 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.