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
@BMoDev2 жыл бұрын
super gratifying to hear that, thanks!
@GBSCronoo2 жыл бұрын
This is my new favorite tutorial channel 👍
@falkkuhnel52987 ай бұрын
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.
@FernandoDenise25582 жыл бұрын
Really well done video, thank you!
@godzillakingkongvenom2 жыл бұрын
Lovin the pace here! Great vid
@Stompin402 жыл бұрын
Wonderful video!
@suicune20012 жыл бұрын
Thanks! I like making the game over screen a different scene so I don't have to worry about disabling and enabling stuff.
@BMoDev2 жыл бұрын
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
@revmatch6r2 жыл бұрын
Great vid dude. Really love event driven architecture even outside of game dev
@_Garm_2 жыл бұрын
Great stuff! :D
@BMoDev2 жыл бұрын
Thanks!
@catherine9712-i8j2 жыл бұрын
BRO. thanks. this is sick, please keep making videos. extremely dig the way you talk and explain things
@BMoDev2 жыл бұрын
Thanks! Appreciate that
@TheOnlyKaas2 жыл бұрын
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 Жыл бұрын
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?
@majou6752 жыл бұрын
the best tutoriall!!!!!
@AstralNostalgia11 ай бұрын
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.
@johnrayaniag68412 жыл бұрын
hey may i ask if how will the death animation work once the GameOverScreen comesout?
@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
@CoreyBarlow2 жыл бұрын
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
@CoreyBarlow2 жыл бұрын
im an idiot, i misspelt active
@anythingpeteives2 жыл бұрын
But why is there a private void OnDisable method which has -= EnableGameOverMenu. That seems to do nothing. Is it even needed?
@muhamadabdullah13912 жыл бұрын
unity cannot accept (Action) as a datatype despite i wrote using system; in the top of the script can u tell me why ?
@ashtonobrien10432 жыл бұрын
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
@KBforJesusChrist2 жыл бұрын
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
@fryptompt2 жыл бұрын
thank you so much sir!!
@eileeng24922 жыл бұрын
I actually think I understand it after this video. Thanks
@durrium2 жыл бұрын
I don't really get this.. What is the difference of just having a normal function which will get called on death? :)
@animationsbelike2 жыл бұрын
Nice! :D
@saylasgrivz Жыл бұрын
thanks
@OmeedNOuhadi Жыл бұрын
👏👏👏
@a-minus-b-equals-a2 жыл бұрын
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.
@BMoDev2 жыл бұрын
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-a2 жыл бұрын
@@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 Жыл бұрын
@@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 Жыл бұрын
@@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.
@FNNYNTFND2 жыл бұрын
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 Жыл бұрын
it worked thanks bro
@branidev2 жыл бұрын
cool
@rushikeshdawange28702 жыл бұрын
how many subscribers did you get by repeating this subscribe word