Тёмный
Game Dev Beginner
Game Dev Beginner
Game Dev Beginner
Подписаться
In-depth game development tutorials and resources for beginners.
Комментарии
@Fossilsmudge
@Fossilsmudge 9 часов назад
just started learning unity and your vids are a breath of fresh air, easy to follow and very helpful!
@CyberAngel67
@CyberAngel67 11 часов назад
You have a number of errors in your video, but the most concerning one is the OnEnabled() and OnDisabled(), this is not called when a script is enabled or disabled. Scripts are typically not disabled, they only stop the update methods like Update, FixedUpdate and LateUpdate from running. And these events are called when the Game Object is Enabled and Disabled.
@GameDevBeginner
@GameDevBeginner 10 часов назад
OnEnable and OnDisable are absolutely called whenever a script, or its object, or it's object's parent, etc. is turned on or off, or the object is created / destroyed. That's what those event messages are for. A disabled script won't receive event messages (like Update) but yes it is possible to call a function on a 'disabled' script. Which is why the enabled checkbox disappears if you remove all of the event messages. I don't believe that I misrepresented any of that in the video, so I'm not sure what your point is? Help me out here?
@CyberAngel67
@CyberAngel67 9 часов назад
@@GameDevBeginner You're correct, sorry I mispoke about that
@GameDevBeginner
@GameDevBeginner 8 часов назад
No worries 👍🏻
@Atenvardo
@Atenvardo 18 часов назад
Love out! Another great video, on a random side note, what IDE do you use? Looks very clean for Mac which is nice.
@GameDevBeginner
@GameDevBeginner 15 часов назад
Visual Studio, which is unfortunately, now discontinued on mac 😭
@Atenvardo
@Atenvardo 13 часов назад
@@GameDevBeginner Ohhh I heard that, what’s the next alternative? Only one I have found that runs good on Mac on par is Rider, paid unfortunately ): But great with Unity
@GameDevBeginner
@GameDevBeginner 8 часов назад
I'll probably try VS Code next, or whatever is offered up with Unity by default, if only for the sake of using what beginners will ultimately use too. I have heard Rider is good though.
@esnevip
@esnevip 18 часов назад
Reupload less than a day in?
@GameDevBeginner
@GameDevBeginner 15 часов назад
no? are you asking because of the thumbnail? RU-vid lets you test them.
@esnevip
@esnevip 13 часов назад
@@GameDevBeginner if the thumbnail changed it might be why
@GameDevBeginner
@GameDevBeginner 8 часов назад
That'll be it then. There was a clear winner so I ended the thumbnail test early.
@nTu4Ka
@nTu4Ka День назад
Celeste was coded as one big class afaik.
@GameDevBeginner
@GameDevBeginner День назад
Really? cool!
@GameDevBeginner
@GameDevBeginner День назад
One thing to add to this, in this example I used an interface to make the connection abstract from both sides in code, but that's not the only way to do it. For example, in my course, which this example is from, I ended up using a Unity Event. The end result is similar, except that the fire display doesn't need to actively do anything.
@notadev9000
@notadev9000 День назад
So in your example, does the fireDisplay still subscribe to OnThrust action defined in IMoveable? And all IMoveable objects can invoke that action when they move?
@GameDevBeginner
@GameDevBeginner День назад
Yes, and yes. Anything that implements IMoveable would need to include it.
@simplycoding347
@simplycoding347 День назад
Great ❤😊
@dibaterman
@dibaterman День назад
Imo, single responsibility is best used when dealing with AI behavior. For most other scripts it's just about a free for all. But doing things like splitting up the jump behavior then allows you to adjust exactly how that jump behavior will work as well. Take it to the next step you can store the behavior as a SO which can be swapped as needed.
@GameDevBeginner
@GameDevBeginner День назад
Neat idea with the scriptable object, would be ideal for that.
@dibaterman
@dibaterman День назад
@@GameDevBeginner More than an idea, it's my usual approach, honestly I'd love to share my state machine architecture with anyone I come across, if you are interested. I have 0 talent for doing videos but I feel the SM would benefit a lot of people.
@dibaterman
@dibaterman 23 часа назад
I just did a Live Stream helping someone get into C#, that's my best way to give back.
@patrickbielau6919
@patrickbielau6919 День назад
the text display in your video is aesthetically pleasing. And the you do a great job in giving options, not doctrines. That's rare in the coding scene :)
@chizuru1999
@chizuru1999 День назад
Can you please share what font and theme you use in jetbrains? Awesome video btw.
@GameDevBeginner
@GameDevBeginner День назад
So it was visual studio, gruvbox theme, and I think the font is menlo 👍🏻
@chizuru1999
@chizuru1999 День назад
@@GameDevBeginner ye i thought its gruvbox, i use in vscode but isnt the mac version for vs discontinued? Thanks
@GameDevBeginner
@GameDevBeginner День назад
@@chizuru1999 It is and it's a shame because, even though VS Code has gruvbox themes, none of them look exactly like my visual studio one, which I love!
@chizuru1999
@chizuru1999 День назад
@@GameDevBeginner Yes bro. They feel totally different lol. And I guess its something to do with apple not allowing it. And its a headache to maintain the visual studio for linux/mac. Last time I checked it works on mono only. Thankfully I mostly use win for work 😁
@mattallenclosedforum9505
@mattallenclosedforum9505 День назад
I always think, if the scripts are small are modular I can use them for multiple projects. And then I start from scratch every time 😂
@kozmobotgames
@kozmobotgames День назад
Thanks for the tutorial!
@immortalsun
@immortalsun День назад
Very useful, Mr British Man, thank you!
@Hoptronics
@Hoptronics День назад
Very consise.. love it..
@Timmel7
@Timmel7 День назад
From what I've heard here, I don't think I'd ever want to work with you. Instead of using the simplest principles to write good code, it seems like you write bad code and then put a lot of thought into justifying your misdeeds by misinterpreting those principles.
@_PadoStudio
@_PadoStudio День назад
He should be over 100k subscribers.... algorithm do you WORK
@batty251
@batty251 2 дня назад
This is how I usually do Unity scripts: Usually if something that has movement its all in a movement script for that game Object and then a separate animations script that handles the animations. For everything else if its a global variable I use containers via scriptable objects. UI script for UI systems. Interactions are usually done on the Game Object's movement script unless its a global then I have a dedicated script that handles like a bullet hitting a game Object so it adds force. I like to have my scripts used in a global setting not just to 1 game Object specifically. A door script can have just a door script to every door or if its a portal then a portal script to every portal and have the scene loaded in as a string array and u pick what scene it will go to from that array etc. This is helpful thinking and I enjoyed the video.
@junba1810
@junba1810 2 дня назад
Your channel is insanely underrated! I also want to note that the blog's on the website are really useful too! When I am actually working in Unity I prefer reading than watching a video, so it's really helpful!
@mikhailhumphries
@mikhailhumphries 2 дня назад
What was that system. thing?
@GameDevBeginner
@GameDevBeginner День назад
The Action? it's a ready made delegate, with a void return type and that takes, in this case, a float. I only put system in front of it because I hadn't added the System namespace to the top of the class. See this video for more: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-J01z1F-du-E.htmlsi=RWUbPiRSqMOxD8UG&t=398
@black_squall
@black_squall 2 дня назад
My favorite unity tutorial guy.
@Niyazi-01
@Niyazi-01 2 дня назад
This is exactly what I'm dealing with right now for my school project. I'm either abstracting everything to eternity or can't seperate a class properly fearing of communication between parts will be pain in the ass in future. I guess practice will be the answer to this problem. I will pick a way and it will cause problems when I decide to change something in future and I will learn from it and improve my decision making in future projects. Not doing anything because of fear of failure is always worse than doing something and fail.
@watercat1248
@watercat1248 2 дня назад
to be fer i use all kind off method's. for example the player movement for my game have movement,jump,ground check all on the same code and it's interesting for all the other codes. however some code in my game is like chin because i haven't though for better system for example on the game im working on is multiple game and many off my weapons i will have the same type off ammo, that means i need to have 2 codes one for the ammo type and one for whatever weapon the use the same ammunition. in general i prefer to make evry code impeding with each other in few words to work on it's own but unfortunately for that is not possible for my project the reason is because my game is complex and some system's have to refresh other codes one good example for this is the PlayerHelth for my game it have 3 or more code in the order to work's correctly 1. one code that it's just the player health. 2. that is hurt box. 3. whatever object dealing damages to the player my point no matter what wii do wean i make health for my player i have to use at least 2 code one for the health and the other in the order to do the damage or heal the player. and i don't even mention all the other part that effects by the for health like kill death ect, that it's crucial in multiplayer PvP fps Game.
@bane9109
@bane9109 2 дня назад
Been doing gamedev for around 2.5 years and this is still something that I sometimes struggle with. It has improved the longer I’ve been coding, but sometimes still difficult to decide. Thanks for the video!
@andisarifi5805
@andisarifi5805 2 дня назад
A unity scripting course? Sign me up!
@hello.4693
@hello.4693 7 дней назад
As far as i know unity, layers + raycast (or atleast overall layers) are the most, unnecessarily overcomplicated bs. They should be waaaaay easier.
@Niyazi-01
@Niyazi-01 7 дней назад
Which IDE and theme are you using in this video? @GameDevBeginner
@GameDevBeginner
@GameDevBeginner 7 дней назад
Visual Studio + Gruvbox
@yann-pennaneac
@yann-pennaneac 10 дней назад
update : unity plus do not exist anymore. Unity pro will go up to 200k $ before you need to subscribe. And that's all.
@fieldtrip2178
@fieldtrip2178 11 дней назад
Should just have said "EventBus".
@GameDevBeginner
@GameDevBeginner 10 дней назад
Oh is that what it is!? I did wonder if it had an actual name.
@giampaolomannucci8281
@giampaolomannucci8281 11 дней назад
I don't get the IF ELSE at 2:20 you either destroy OR create, you never destroy AND create, because the IF is evaluated once, isn't it? shouldn't the creation be outside of the ELSE, at the end of the function, and always be executed? this way IF the instance exists, it will delete it and then will proceed with creating it anyway
@GameDevBeginner
@GameDevBeginner 10 дней назад
In a scenario where multiple singleton instances exist, the Awake function and, in turn, the if/else would be executed for each of them. In my example, the only situation in which the singleton is set is if the instance field is empty. You could do it in different ways, such as have the destroy check first and then put the instance set outside of the if/else like you suggested, but if you do that, you must return after the destroy line, otherwise you could have a situation where the function continues to setting itself as the instance, even though it's about to be destroyed.
@cl2401
@cl2401 12 дней назад
horizons expanded!
@mehmeh8883
@mehmeh8883 13 дней назад
Do you animate these videos using code?
@GameDevBeginner
@GameDevBeginner 13 дней назад
Unless I'm doing something with physics, like the falling numbers animation in my online course video, I don't use code. I usually keyframe everything in davinci resolve.
@mehmeh8883
@mehmeh8883 13 дней назад
​@@GameDevBeginner Nice! Thanks
@mehmeh8883
@mehmeh8883 13 дней назад
New vids when?
@mehmeh8883
@mehmeh8883 13 дней назад
Nevermind you posted 4 days ago, didn't get a notification hehe
@GameDevBeginner
@GameDevBeginner 12 дней назад
Expect more soon though!
@deraminator945
@deraminator945 14 дней назад
So a Coroutine cannot be paused and continued?
@GameDevBeginner
@GameDevBeginner 14 дней назад
They absolutely can, but not randomly, meaning that you'll need to specify a point in the coroutine that it will be able to wait, such as an if condition with yield return null statement for example. If you mean 'can they be paused when the game is paused?' Then yes, in the same way that everything else is, usually by setting timescale to zero.
@zamika2100
@zamika2100 17 дней назад
It's hands down the best explanation about delegates and events! I've been struggling to fully grasp this subject for a long time, but now I really understand it! I just should watch it a couple more times to make sure that I did. THANK YOU!
@louie2
@louie2 17 дней назад
goddam youre a good teacher
@batty251
@batty251 17 дней назад
I have found using a Coroutine instead of an Update Function and compressing everything from a big block of code and separate functions into a single IEnumerator makes the code run with out mistakes or forgetting anything especially Booleans.
@RageGames_
@RageGames_ 17 дней назад
lord GDB.
@black_squall
@black_squall 18 дней назад
Quality vid thankyou
@DarthBiomech
@DarthBiomech 18 дней назад
4:20 IIRC, it's important to mention that Awake _doesn't_ behave like that and will be called _immediately_ as you instantiate a new object through the code.
@GameDevBeginner
@GameDevBeginner 18 дней назад
My mistake, I just double checked and you're right. Initialisation functions, Awake, OnEnable, and Start, are called immediately. And in the test I just did, decommissioning functions were as well. I've removed the statement that was incorrect in this video, I'll correct the video in the course, and I'll pin your comment. Thanks.
@DarthBiomech
@DarthBiomech 17 дней назад
@@GameDevBeginner Oh, even the _Start_ is called? I didn't know that. ^^" Shame that it doesn't behave like that though, would've made dealing with instantiated objects much easier...
@GameDevBeginner
@GameDevBeginner 17 дней назад
@@DarthBiomech Apparently so. In the test I did, instantiating an object in Update caused Awake, OnEnable, and Start to be called immediately. So while Start is always called before Update in the context of that script, if you're creating objects at runtime (or enabling them) you can also have a situation where one object's start is called after another object's update in the frame it was created in.
@Briezar
@Briezar 17 дней назад
it's also important to know that if you instantiate an inactive prefab, Awake and all other functions won't be called until the first time it is active. That's why setting dependencies inside Awake is not always the best idea, in this case serialized or lazy dependencies would be better.
@MAGNETO-i1i
@MAGNETO-i1i 18 дней назад
Thanks! I learned a lot
@Galaxy_World
@Galaxy_World 18 дней назад
re-upload :o
@GameDevBeginner
@GameDevBeginner 18 дней назад
Yeah, sorry about that there was a problem with the first upload.
@fuzionstreaming
@fuzionstreaming 18 дней назад
I saw the notification then the video got private. And 1 hour later it was back in public. So, First.
@GameDevBeginner
@GameDevBeginner 18 дней назад
There was a problem with the first upload so I had to do it again.
@tejasbele1456
@tejasbele1456 18 дней назад
Very Informative
@ahmed_nady_20
@ahmed_nady_20 21 день назад
how to make double jump in this code wihtout physics
@Gaisiran
@Gaisiran 24 дня назад
I was going to try and use a singleton for an enemy wave sequencing spawning system and have the UI Manager and Spawn manager communicate… sound like a good idea?
@GameDevBeginner
@GameDevBeginner 23 дня назад
Yeah, so long as there's only ever going to one of each you should be fine.
@TheMisterixxx
@TheMisterixxx 25 дней назад
why is this so difficult
@opps5915
@opps5915 25 дней назад
I prefer to use only one script for each object (for player's stats, movement, audio, etc) .. and access other objects's scripts via tags.. i think it is the best way for me to develop a game.. instead of creating potential bug, I'd force CPU to find script which todaya CPUs are fast and also I am not developing GTA, Eldenring etc. Fk it!
@alpercizmeci4039
@alpercizmeci4039 Месяц назад
Superb tutorial!