GAME OVER Menu In Unity Tutorial

  Рет қаралды 27,761

BMo

BMo

Күн бұрын

Пікірлер: 42
@alexh3027
@alexh3027 2 жыл бұрын
These videos are just so clear. This video has clicked a whole bunch of your other videos into place in my head and now I feel I have events clarified in a context I needed. My game is already much cleaner through your tutorials. So thank you
@BMoDev
@BMoDev 2 жыл бұрын
super gratifying to hear that, thanks!
@GBSCronoo
@GBSCronoo 2 жыл бұрын
This is my new favorite tutorial channel 👍
@falkkuhnel5298
@falkkuhnel5298 7 ай бұрын
Just to mention it, you can use Actions with parameters: public static Action OnDamage for example to pass an integer as the amount of damage to take.
@FernandoDenise2558
@FernandoDenise2558 2 жыл бұрын
Really well done video, thank you!
@godzillakingkongvenom
@godzillakingkongvenom 2 жыл бұрын
Lovin the pace here! Great vid
@Stompin40
@Stompin40 2 жыл бұрын
Wonderful video!
@suicune2001
@suicune2001 2 жыл бұрын
Thanks! I like making the game over screen a different scene so I don't have to worry about disabling and enabling stuff.
@BMoDev
@BMoDev 2 жыл бұрын
Yeah thats a much simpler way, thought itd be more useful to show an in game menu, but sometimes im lazy and just change scenes, especially in game jams lol
@revmatch6r
@revmatch6r 2 жыл бұрын
Great vid dude. Really love event driven architecture even outside of game dev
@_Garm_
@_Garm_ 2 жыл бұрын
Great stuff! :D
@BMoDev
@BMoDev 2 жыл бұрын
Thanks!
@catherine9712-i8j
@catherine9712-i8j 2 жыл бұрын
BRO. thanks. this is sick, please keep making videos. extremely dig the way you talk and explain things
@BMoDev
@BMoDev 2 жыл бұрын
Thanks! Appreciate that
@TheOnlyKaas
@TheOnlyKaas 2 жыл бұрын
Is it possible to have the code files in a google drive or something, because this doesn't work for me right now it just does nothing.
@DextraVisual
@DextraVisual Жыл бұрын
My PlayerHealth has an OnDestroy(object); instruction instead of OnPlayerDeath. Will the Destroy work in its place without having to replace and relink all of my player scripts with your Health script?
@majou675
@majou675 2 жыл бұрын
the best tutoriall!!!!!
@AstralNostalgia
@AstralNostalgia 11 ай бұрын
whatis your visual studio theme? or you are using a custom editor to change user-methods,delegate,etc??? I do not like Monokai is too noise for me!! but your theme is cool , I am trying to find something cool to not distract my attention, I use the default one,but I just change some things in the color of property and local variables.
@johnrayaniag6841
@johnrayaniag6841 2 жыл бұрын
hey may i ask if how will the death animation work once the GameOverScreen comesout?
@eeezxbxzkgjzgvjzcyjvgz
@eeezxbxzkgjzgvjzcyjvgz Жыл бұрын
hey for some reasin i cant see my buttons or texts and more but they are there, also the screen dosent pop up for me (I saw the buttons and stuff before) does anyone have any idea why
@CoreyBarlow
@CoreyBarlow 2 жыл бұрын
Assets\Scripts\UIManager.cs(24,22): error CS1061: 'GameObject' does not contain a definition for 'SetAcive' and no accessible extension method 'SetAcive' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?) any ideas? iv also tried GameOverMenu.gameObject.SetAcive(true); but this didn't work either
@CoreyBarlow
@CoreyBarlow 2 жыл бұрын
im an idiot, i misspelt active
@anythingpeteives
@anythingpeteives 2 жыл бұрын
But why is there a private void OnDisable method which has -= EnableGameOverMenu. That seems to do nothing. Is it even needed?
@muhamadabdullah1391
@muhamadabdullah1391 2 жыл бұрын
unity cannot accept (Action) as a datatype despite i wrote using system; in the top of the script can u tell me why ?
@ashtonobrien1043
@ashtonobrien1043 2 жыл бұрын
Dont know why but my player stays static whenever I click the restart button, like I know why because it disables movement and doesnt enable it again because it only enables it again on void start like what did I miss
@KBforJesusChrist
@KBforJesusChrist 2 жыл бұрын
Timer out lose condition I'm a complete beginner trying to make a game I'm stuck on the time out trigger lose I haven't found a tutorial talking about it
@fryptompt
@fryptompt 2 жыл бұрын
thank you so much sir!!
@eileeng2492
@eileeng2492 2 жыл бұрын
I actually think I understand it after this video. Thanks
@durrium
@durrium 2 жыл бұрын
I don't really get this.. What is the difference of just having a normal function which will get called on death? :)
@animationsbelike
@animationsbelike 2 жыл бұрын
Nice! :D
@saylasgrivz
@saylasgrivz Жыл бұрын
thanks
@OmeedNOuhadi
@OmeedNOuhadi Жыл бұрын
👏👏👏
@a-minus-b-equals-a
@a-minus-b-equals-a 2 жыл бұрын
Note that doing it in this way will lock you out from creating multiplayer/co-op games. If you later decide to make your game co-op, you'll need to change lots of logic. Static things are comfy, but they are inflexible and untestable.
@BMoDev
@BMoDev 2 жыл бұрын
Static variables being Inflexible is a fair enough point, but you can absolutely make a local multiplayer game with this method. Its literally just an event, theres no reason you cant track multiple players and have a gameover screen show when theyve met the lose condition.
@a-minus-b-equals-a
@a-minus-b-equals-a 2 жыл бұрын
​@@BMoDev If you write a single-player game with this method and later decide to add multiplayer, you'll have to rewrite a lot of stuff to support it. Of course, in a "if one dies everyone loses" scenario it doesn't matter, but if you want to add respawning mechanics and the likes, it's going to be a mess. For example: the lack of a sender parameter. With the event you've created, the subscribers have no easy way of finding out who called them. What will you do if there's multiple PlayerHealth? An obvious solution is to add the PlayerHealth(or, even better, an identifier for the specific player) to the Action's parameters, but that will require changing all subscribing classes & methods to accommodate the new parameter. Little things like that accumulate until making a change means rewriting half the application. It's, of course, not limited to just this method. The reason I've written this comment at all is because I think it's VERY important to reflect before making a static method/variable/whatever. It's important to consider whether it will hinder you in the future, were you to decide to add/change something. So, I'm against giving these kinds of suggestions in tutorials. A place where I would use static(though, in this case, a straightforward const would work better) is for scenes names. I'd just put them all in a static class. That way you won't need magic strings/integers when changing the scene with SceneManager.LoadScene(); which will also allow you to change scenes' names without breaking any code(as you'd only need to update the static class's const string).
@Barldon
@Barldon Жыл бұрын
@@a-minus-b-equals-a Late reply, but that is an incredibly simple solution. Instead of having an event on the class, you have it on an interface, which means it doesn't matter which class implements the event. You can attach a sender either as you stated, or you can use the EventHandler class instead of the Action class, which automatically attaches a sender. I'd be interested to know what method you feel suits this better than statics, as I've yet to see a convincing argument for another implementation.
@a-minus-b-equals-a
@a-minus-b-equals-a Жыл бұрын
​@@Barldon The issue isn't that there's no solution-the issue is that applying a different solution in late development will require manually editing all the existing callers(and if you use this kind of pattern a lot, that could mean whole rewrites). This applies both to my solution and to the usage of a EventHandler. Said that, I'm kinda confused on how moving the event to an interface will help identify which player launched the event. The main point to consider is that static things are inflexible, hard to mock, and hard to modify late in development-they're imho more reserved for things that semantically will never change(like math-related stuff). For small projects and things with clear scopes this is mostly fine(basically trading off flexibility for ease of development), though if you were planning differently I'd put in some system of identifying users from the get-go, whether by passing in an id, or by registering an event for each different player. My only real issue with the static issue here is that it's presented in a beginner-focused tutorial as the "go-to" solution without mentioning the important trade-offs it has.
@FNNYNTFND
@FNNYNTFND 2 жыл бұрын
great video and if you are tryng to make the player not move on 3d try this public void EnableGameOverMenu() { GameOverMenu.SetActive(true); Player.gameObject.GetComponent().enabled = false; } hope i helped
@kaz7342
@kaz7342 Жыл бұрын
it worked thanks bro
@branidev
@branidev 2 жыл бұрын
cool
@rushikeshdawange2870
@rushikeshdawange2870 2 жыл бұрын
how many subscribers did you get by repeating this subscribe word
Setup 3D Pathfinding Agents In Minutes Using Unity
7:41
Easy Heart Health System in Unity
16:03
BMo
Рет қаралды 20 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Game Over Screen Unity Tutorial
14:35
MoreBBlakeyyy
Рет қаралды 49 М.
PAUSE MENU in Unity
12:13
Brackeys
Рет қаралды 998 М.
START MENU in Unity
12:52
Brackeys
Рет қаралды 3,1 МЛН
I Made a Racing Game and My Viewers Destroyed It...
6:19
ZenDuck Apps
Рет қаралды 801
A Great Way To Setup POWERUPS In Your Unity Game
13:43
GAME OVER - How to make a Video Game in Unity (E08)
12:11
Brackeys
Рет қаралды 1,3 МЛН
How To DAMAGE Enemies in Unity
9:19
BMo
Рет қаралды 45 М.
SETTINGS MENU in Unity
17:22
Brackeys
Рет қаралды 958 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН