This seems like such a nice workflow. No strict inheritance and no spaghetti either.
@Evermus4 ай бұрын
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 !
@drawtheword759024 күн бұрын
there are supersizing few tutorials teaching on this method of using components so thank you for your contribution to this subject
@sanslesquelette9875 ай бұрын
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")
@CrimsonFox365 ай бұрын
You also need to add body: CharacterBody2D to the move_animation function thank you for your help.
@sanslesquelette9875 ай бұрын
@@CrimsonFox36 yes exactly, thanks for your help too
@JustSteve856 ай бұрын
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.
@not-a-lot-of-options4 ай бұрын
Put the game engine in the title...
@GoblinBoi6666 ай бұрын
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!!
@RetroCrowDev6 ай бұрын
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 ".
@kylemiller676516 күн бұрын
Ive followed this tutorial twice over now and the game bricks every time. It just crashes when launched.
@srspanksalot45015 ай бұрын
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.
@PandaManArchives3 ай бұрын
Line 10:Mixed use of tabs and spaces for indentation.
@GregX9998 ай бұрын
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.)
@Unain8 ай бұрын
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
@eleni_stathopoulou7 ай бұрын
My animations for jumping and falling have two frames, but it only plays the first ones. Is there a way to fix that?
@vrts6 ай бұрын
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
@detriativora3 ай бұрын
i have the same problem. do you already found the solution to fix that?
@RickyHartII3 ай бұрын
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.
@emredikmen27610 ай бұрын
Hello Unain , would you consider shooting videos with Laravel livewire in the future for example, making a crm application
@Unain10 ай бұрын
Maybe in the future
@Not-YourCheese10 ай бұрын
What did you mean by "so the enemy has to think for itself"? Do I have to make a basic enemy AI component, like, move right, than left, than right, than left, etc. or would I have to do something else?
@Unain10 ай бұрын
Yeah, you can make a component that does the thinking for the AI. So it can decide where it wants to go and then it calls the movement component to go there.
@Not-YourCheese10 ай бұрын
@@Unain 👍
@Not-YourCheese10 ай бұрын
@@Unain Hey, could you give me some pointers on how I should make the AI without directly giving me the code, cause I actually want to learn how to make it, and I can't figure it out for the life of me. 😕