Тёмный
Unain
Unain
Unain
Подписаться
Hi! I'm Unain! I make videos about game engines. On my channel, you'll find tutorials, tips and tricks, and occasionally news about game engine releases. Remember to subscribe!

Enjoy :).
Комментарии
@Mw1ng0l3
@Mw1ng0l3 19 дней назад
How can adapt it to 2D game?
@isaacdobson8760
@isaacdobson8760 23 дня назад
you have a wonderful voice
@PandaManArchives
@PandaManArchives Месяц назад
Line 10:Mixed use of tabs and spaces for indentation.
@RickyHartII
@RickyHartII Месяц назад
I'm having issues with the movement and jump animation overriding each other. They work separately however when I use both the jump animation overrides the movement. So the jump animation works but the movement doesn't. I used print to try to debug and it is reading that its in run or idle but the animations do not play. I think this is a great concept and I think this is a high value tutorial. I'm just stuck trying to figure this out. Any help would be appreciated. I am fairly new to this but have some understanding.
@not-alot-of-options
@not-alot-of-options Месяц назад
Put the game engine in the title...
@yusufirawan3832
@yusufirawan3832 Месяц назад
Wow! thanks for tutorial😁
@Evermus
@Evermus Месяц назад
Best tutorial I've seen so far. Clean code with class for each feature. Not a total mess in the player script as we can see in other tutorials. As someone new to Godot but not to coding I'm happy to have found this video. Thanks !
@rremnar
@rremnar Месяц назад
I always thought resource files were a compiled construct for a type of object for the Windows OS. Perhaps it's different for Godot? Regardless, this is a good tutorial, thanks.
@young_leosia_fan
@young_leosia_fan День назад
Why for windows specifically?
@luisv1308
@luisv1308 Месяц назад
Thank you sir, I hope you make more godot videos in the future
@randomguy0071
@randomguy0071 Месяц назад
what's the difference between scene and packedscene?
@EoGReconMessenger
@EoGReconMessenger 2 месяца назад
Thank you for the video, had trouble finding documentation for it (probably just looking in the wrong places). But this video was exactly what I was looking for. Thank you so much :)
@UndeadMunchies
@UndeadMunchies 2 месяца назад
I suppose I understand how they work now. I just am struggling to understand *why* you would use them. Everything shown here does not need a resource to do in any way, and if anything is made more complicated by using them. What is a use case where a resource is the clear option over just extending off of a custom class or using a script template?
@Peak_Stone
@Peak_Stone 23 дня назад
From what I understand, it reduces references and dependencies and helps in error tracking. if there is a bug, you can to ognore respurces as they are inert. if however all your variables are stored in scripts, then you jave to reason about them not the best answer. but its the best i can do
@sanslesquelette987
@sanslesquelette987 2 месяца назад
If some people struggle to make their actual jumps animated, there is an altercation between the jump animation and the ground animation. To fix this, you have to be more precise when you want that your "ground" animations (running and idle) play. In our case, they play only when the character is on ground, so it will look like something like this : if move_direction != 0 and body.is_on_floor(): sprite.play("Run") elif move_direction == 0 and body.is_on_floor() : sprite.play("Idle_Combat") func handle_jump_animation(is_jumping:bool, is_falling:bool) -> void: if is_jumping: sprite.play("Jump") elif is_falling: sprite.play("Fall")
@CrimsonFox36
@CrimsonFox36 2 месяца назад
You also need to add body: CharacterBody2D to the move_animation function thank you for your help.
@sanslesquelette987
@sanslesquelette987 2 месяца назад
@@CrimsonFox36 yes exactly, thanks for your help too
@stabbedbyapanda
@stabbedbyapanda 2 месяца назад
Thank you, i've watched 4 explanations on Resources, but this one made it the clearest. One thing I'm still struggling to understand is what functions i should contain in a resource vs in the scene script. Still mulling that one over. Ahhh a fellow Unreal dev to Godot!
@Cr1i_
@Cr1i_ 2 месяца назад
Hii, I'm a beginner and I've been using your movement tutorials for my very first game, and I actually love them! But for my taste I don't really like how abrupt the falling is in the variable jump height, if there's a way I can make my character reach the max height in just a bit more time and make the falling less sudden and smoother I would really appreciate your help Thank you in advance if you'll answer my question : )
@vladimirharamincic1204
@vladimirharamincic1204 3 месяца назад
Cast to primitive component does not show in UE5.4
@agriasoaks6721
@agriasoaks6721 3 месяца назад
In nested custom resource, is it possible for the child (I'm not sure if I'm using the term correctly) resource to get the property of its parent's property?
@stabbedbyapanda
@stabbedbyapanda 2 месяца назад
If you are saying something like BaseSkillResource -> FireSkillResource -> FireballSkillResource. It should be able to, i haven't tested it but i don't see why it wouldn't. You should be able to test it real quick, by just making a function to print something when called in the grandparent
@agriasoaks6721
@agriasoaks6721 2 месяца назад
@@stabbedbyapanda No no no, It's more like Skill resource that has a property called effect (array) that holds another custom resource class called SkillEffect. I wonder if this SkillEffect can access the property of the Skill class where it is in
@stabbedbyapanda
@stabbedbyapanda 2 месяца назад
@@agriasoaks6721 oh I think that's a case of using signals. Or creating a var reference to specific classes
@agriasoaks6721
@agriasoaks6721 2 месяца назад
@@stabbedbyapanda Well in that case, could you give an example of how to use signal to communicate between custom resource .tres files please?
@stabbedbyapanda
@stabbedbyapanda 2 месяца назад
@@agriasoaks6721 Sorry I can't i'm also learning about resources. You may not be able to communicate between resources with signals either the more i think about it, you will just have to test :/ If it doesn't work my recommendation would be to have a scene that loads your resources and then you can reference them together. (I think) This would act as a manager that handles what you want.
@srspanksalot4501
@srspanksalot4501 3 месяца назад
I think that after the tutorial I will probably handle input within the player script and then I will use signals to connect to the other components. Directly referencing the components in the player code is kind of defeating the point of using components IMO. Yes you are breaking your code into smaller pieces, but I think godot would vastly prefer if you used signals to communicate. if I just emit a signal like "player jumped" then all of the components can deal with it from there, without my player needing to do wonder about anything.
@rumodan
@rumodan 3 месяца назад
That's a really good couple of videos, detailed and well explained, with the right pacing for a newby. Really appreciated! The only thing I don't like is the sudden stop of the y velocity when jump input is released; IMHO it would look nicer if the movement continued with the fall gravity applied, it would look more natural. I'll try to implement it in the project I'm working on... Project that I'm currently refactoring using your modular approach! Keep posting please, that's quality content!
@AxelBurned
@AxelBurned 3 месяца назад
I had the same thought. What I ended up doing was establishing a new variable var is_at_peak: bool = false Then I defined it right under "is_going_up" as is_at_peak = body.velocity.y > -150 and not body.is_on_floor() Then I changed the jump release call to if jump_released and is_going_up and not is_at_peak: Finally, I changed my jump_released_velocity to float = -150 I didn't add the is_at_peak at first, and it made my character do a sort of double-jump if I released at the peak, so adding in that other check tells the game that if you release at the end of the jump, just treat it like a full jump. Probably could be a lot more sophisticated, but it's the first thing I've coded for myself in the game, and seeing it actually work the way I envisioned it was a real spark of motivation, let me tell you.
@rumodan
@rumodan 2 месяца назад
@@AxelBurned that's a simple but clever way of managing the thing, I was actually thinking of using a jump_complete variable too, and seeing that this approach can work reassures me!
@JustSteve85
@JustSteve85 3 месяца назад
Yeah, so I did ArmA 3 editing before I started messing with Godot, and this is virtually identical to how Bohemia's scripts can be broken into small config modules that are then called to a main config module, keeping you from going through hundreds of lines of code in one big gross config. This is SUPER cool and pleases my OCD. Also, implemented directly from the video with 0 errors. Thanks so much for that.
@fatodeta
@fatodeta 3 месяца назад
I think you've found one of the best ways in transferring knowledge. Really awesome content! Thank you!
@Kemwood
@Kemwood 3 месяца назад
Great tutorial series! Clear and super helpful. Please keep them coming!
@rororoFGC
@rororoFGC 3 месяца назад
does any one have a problem of Nodes section on Player not showing? It looks like a bug and I don't know what to do.
@Unain
@Unain 3 месяца назад
That's a weird one, you could maybe select a different node in the scene tree. And then select the player node again which should refresh the exported variables on the right. Also make sure the player script is saved.
@rororoFGC
@rororoFGC 3 месяца назад
@@Unain I think I solved it. It happened when I made de Advanced Jump Component and added do the Player. Then two lines got red, the "handle_jump" and handle_animation_jump". I guess something brook and the Nodes disappeared from the inspector. To resolve that I added # in front of the red lines and the Nodes reappeared and I was able to add the ADV Jump Component in the correct Node Box. After that everything was correct! Awesome tutorial!
@Unain
@Unain 3 месяца назад
@@rororoFGC Ah yes, if there is any error in another referenced node then it will not update the export variables. Glad you got it working :)
@GoblinBoi666
@GoblinBoi666 4 месяца назад
At 6:37 you assign the gravity component to the player, i CANT for the life of me figure out how you did that. How do you find/open that little "Nodes" option? Help lol!!
@RetroCroww
@RetroCroww 3 месяца назад
That comes from him adding the @export in front of the line " var gravity_component: GravityComponent " and the "Nodes" option comes from the line above it, " @export_subgroup("Nodes") ". Neither of these are mandatory, it's just an easy way of referring to the gravity component. You can achieve the same thing by writing " var gravity_component = $GravityComponent ".
@ICSkill101
@ICSkill101 4 месяца назад
I get an error: Invalid get index 'Starting_Health' (on base: 'Nil'). Why so?
@lcdcstudios
@lcdcstudios 3 месяца назад
idk if you are still experiencing a problem but you might want to export your var stats: characterstats in your player character
@ICSkill101
@ICSkill101 3 месяца назад
I solved the problem, don't remeber how.
@willirittmann1917
@willirittmann1917 4 месяца назад
Dont know for you guys, but for me the export variables resets too often and lose its reference, im trying to use export only for debug things or smples stuffs that i can easily redo
@brendanhall3181
@brendanhall3181 4 месяца назад
Best introduction to resources I've found!
@shadowman_93
@shadowman_93 4 месяца назад
you should better stop whistling while talking xD Thanks for the great video!
@Evilprince191
@Evilprince191 4 месяца назад
Great tutorial 😊 May i ask why at 7:02 you load the resource in your method instead of preloading it as export variable like the player scene ?
@Unain
@Unain 4 месяца назад
Around 7:19 I explain why. We can't preload dynamically created paths, because the program doesn't know on compile time what the string is going to contain :).
@b.c.a683
@b.c.a683 4 месяца назад
Thank you , Really like your way. I'm new on godot , I have a question : so resources can be used for creating all the items in the game and saved in that data container whenever needed we can call or already loaded in game. for example I got different type , textures ,and stats of 50 swords , 50 maces and 50 spears so should I have a 150 different files under weapon_resources ?
@eleni_stathopoulou
@eleni_stathopoulou 4 месяца назад
My animations for jumping and falling have two frames, but it only plays the first ones. Is there a way to fix that?
@vrts
@vrts 4 месяца назад
A few things to look at: - using a boolean to prevent additional logic from running until your animation is complete - if animationPlayer.is_playing(): return - _on_animation_player_animation_finished signal
@detriativora
@detriativora 18 дней назад
i have the same problem. do you already found the solution to fix that?
@Wikki-he5ts
@Wikki-he5ts 4 месяца назад
Hugely underrated channel
@Crits-Crafts
@Crits-Crafts 4 месяца назад
really loving this, I hope yoy realease more tutorials. I'm impimenting similar in my game. Where the gravity module is actually attached to each level and is referenced in each entity, keeping them consistant. but also allowing levels to have a single settable custom gravity. Same with input, allowing the player input to easily impact more than one thing at a time (like my mirror deamon, who coppies everything the player does but in reverse) but I dont see the advantage of move, jump and annimate being seperate? I looks nice, but I feel like its of little practical use? Either way, Really loving the video's please do more :)
@oreofilledjoy302
@oreofilledjoy302 5 месяцев назад
Thank you! I've been searching everywhere for a way to load my RPG Job stats!
@Zlorak
@Zlorak 5 месяцев назад
Excellent tutorial, helped me a lot to understand Resources! - I do have one question. I'm working on a RPG card game, where each card has a name, a description, and an effect as a function. It seems like you cannot save functions inside .tres so I guess the right way to save each card would be a scene each?
@Unain
@Unain 5 месяцев назад
You would have one scene that you fill with the information from the card resource. So the texture/description/name you can just get from the resource and load into that scene. For specific card effects I would have a separate node that you can attach to the card which handles the effect. I would recommend checking out: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iLT6pTluYvw.html who is making a Slay The Spire like game to see how he handles the cards :)
@Zlorak
@Zlorak 5 месяцев назад
@@Unain Tysm! I'll def watch it, i was looking for a resource like that one.
@gustavo3220
@gustavo3220 5 месяцев назад
Rechourches 😂😂😂
@alaouiamine3835
@alaouiamine3835 5 месяцев назад
Thank you for the clear tutorial
@GregX999
@GregX999 5 месяцев назад
This component system is so clean!! I'm a fan! (What font are you using in the editor? I really like how narrow it is.)
@Unain
@Unain 5 месяцев назад
Actually the editor font is default, but I use a Custom Display Scale of 0.9 so it seems smaller. You can set the Custom Display Scale in the Editor Settings. It's under Interface -> Editor -> Custom Display Scale
@mkjyt1
@mkjyt1 6 месяцев назад
Thank you!
@HakanBacon
@HakanBacon 6 месяцев назад
Wonderful tutorial! Straight to the point with examples and visuals. Lovely work
@gimgiringim4002
@gimgiringim4002 6 месяцев назад
Hi, I keep getting the error that add_child cannot be called on a null instance when using 2D nodes instead of the 3D versions. Is there any way you could help me with that?
@davids5195
@davids5195 5 месяцев назад
I'm getting a similar error for 2D nodes. For me, it's with the instantiate part. "Cannot call method 'instantiate' on a null value," it says. Never mind. I figured out my issue. I had the @export var for the PackedScene, but I had forgotten to put the desires scene into the editor. So, of course it was a null value, lol
@danielhalond6292
@danielhalond6292 6 месяцев назад
great stuff! thanks!
@47represent
@47represent 6 месяцев назад
very well put together tutorial. could we have a part 3 delving into slopes? I'm currently struggling to impliment running up verticle walls and on ceilings
@Bloom_HD
@Bloom_HD 6 месяцев назад
Very good visuals and explanation. Thank you so much!
@beriadan77
@beriadan77 6 месяцев назад
Please do more! I'm loving your modular approach!!! Learning a LOT from your coding!!!
@someguy56682
@someguy56682 6 месяцев назад
Love this! Would you ever consider making a third part, by chance?
@Izmblueskydownizm
@Izmblueskydownizm 7 месяцев назад
Thank you so much, I managed to use this in my UE5 project
@chuman71
@chuman71 7 месяцев назад
Best video on custom resources for Godot 4.x I found so far! thanks!
@pixobit5882
@pixobit5882 7 месяцев назад
How did you animate the video?
@Unain
@Unain 7 месяцев назад
motioncanvas.io/
@pixobit5882
@pixobit5882 7 месяцев назад
​@@Unaini knew it :D
@Pelipcahh
@Pelipcahh 7 месяцев назад
I would love for you to do some cool features such as a dash/air dash, double jump, grabbing ledges, wall jumps, and more! This is a GREAT series so far!
@Bob-gi2gh
@Bob-gi2gh 2 месяца назад
Would love to see the way those components would work!