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

Did you find this page helpful?