Тёмный
Pefeper
Pefeper
Pefeper
Подписаться
Комментарии
@fibonnaccci
@fibonnaccci 3 дня назад
Should I, as a beginner, start with custom resources or with default resources?
@stephenmackenzie9016
@stephenmackenzie9016 4 дня назад
How to add variable jump height?
@Montymashio
@Montymashio 6 дней назад
amzing!
@FeyFen
@FeyFen 13 дней назад
For those using this tutorial with later versions of Godot4... OpenSimplexNoise is outdated, you can use FastNoiseLite instead, which has simplex and simplex smooth as options.
@tofuutekken123
@tofuutekken123 17 дней назад
Quick note: In games like 2D marios (at least the older one) the way they handle jumping is much more straightforward than you'd think. The jump speed is a constant and the only thing that changes is gravity. In SMB1: the jump speed is 4 (or 5 if you're sprinting), and gravity just changes depending on whether you're holding A or if you've already started falling
@sillygoose8037
@sillygoose8037 19 дней назад
Love the video, gonna rewatch it again.
@KDD0063
@KDD0063 21 день назад
too fast and too hard to understand :( Is there a way to select a resource to use in script instead of in the inspector? I have like 200 enemy stats resources but I will only be fighting 1 enemy at a time, so I think it would make more sense to access 1 resource in the script at a time rather than dumping 200 into an array.... does that make sense? I just want to access 1 resource at a time in script, how would I do that?
@Asbjornn
@Asbjornn 22 дня назад
Thank you so much, this was so useful for my recent project! <3
@m.a.c.86
@m.a.c.86 24 дня назад
amazing thank you
@darknight-mn8fo
@darknight-mn8fo 24 дня назад
I tried to use this for my game. The problem I ran into was that when a jump is intiated and the player collides with a wall before jump_height is reached, the player slides up the wall, till the jump_height, before sliding back down. Is there a way to stop the slide upward, when colliding with the wall. Im new to godot and this is my first game I am developing
@darknight-mn8fo
@darknight-mn8fo 23 дня назад
Nvm, found the solution. Thank you for the tutorial
@JuhoSprite
@JuhoSprite 27 дней назад
Anyone know why time to peak somehow changes the jumpheight? is this supposed to happen??? I just want the jump height parameter to be the single thing determining the height, and jump time to peak only changing the time and not actual jump height
@Pefeper
@Pefeper 27 дней назад
Time to peak should not affect the jump height. Have you tried copying the code from the Github gist to make sure the equations are correct?
@JuhoSprite
@JuhoSprite 27 дней назад
@@Pefeper ok good so it was something with my code then. I haven't tried using your entire player template. I just ended up not using this method and going back to the guessing game. I do like where my player physics is going tho rn.
@JuhoSprite
@JuhoSprite 27 дней назад
@@Pefeper also thanks for still replying to comments years after the videos release. really nice of you gotta appreciate that.
@Pefeper
@Pefeper 27 дней назад
@@JuhoSprite of course!! Good luck with your project!
@AshliBlattgold
@AshliBlattgold Месяц назад
I wish I knew about those sooner, I've spent hours slamming my head against the wall because godot moves around files in the PCK on export. With resources this is a non issue...
@altairlevega6613
@altairlevega6613 Месяц назад
I typed in ResourceSaver.save("user.//savefile/save_file.tres") It gave me an error: Invalid argument for "save()" function: argument 1 should be "Resource" but is "String".
@Lidas11
@Lidas11 Месяц назад
1:14 TIP: If you want to create a unique resource variable (you can do it in the new godot version) use "duplicate" when load/preload.
@_gamma.
@_gamma. Месяц назад
I forked your gist for 4, thanks for the tutorial!
@paulindrome
@paulindrome Месяц назад
You mention resources are "easy to load". Can you explain how? As far as I know there is no function to LoadAllResourcesOfType() at runtime f.e. which was one of the main reasons I stopped trying to learn Godot a while back.
@CubeOrSomething
@CubeOrSomething Месяц назад
Finally, a game developer who doesn't yell.
@user-tl9hl3up8r
@user-tl9hl3up8r Месяц назад
I watched it 3 times. I still don’t understand why resources are needed
@LangsyGamesy
@LangsyGamesy Месяц назад
I just used this create a resource with a user defined Enum that is usable across all nodes. You are a saint my friend, keep up the great work!
@TRUFANATIC
@TRUFANATIC Месяц назад
Thank you so much!
@VoltitanDev
@VoltitanDev 2 месяца назад
Will the setup be different if it was adapted in Godot 4?
@danieloliveira-pq4zy
@danieloliveira-pq4zy 2 месяца назад
OMG this video is just so great! I really loved the crazy pixel art and music hahaha
@thijsriezebeek790
@thijsriezebeek790 2 месяца назад
Small tip : in the timed explosive resource, you manually preload a scene for the explosion. Instead you can also make this an export variable of PackedScene. This has 2 benefits, moving scene file doesn't break the loading and you can now have different explosions!
@OrangeLove-um4dd
@OrangeLove-um4dd 2 месяца назад
This video's style is funky as hell, dude, that makes it an IMMEDIATE go-to for me to watch!
@felfar197
@felfar197 2 месяца назад
such a nice video :) ♡♡♡
@deamorta6117
@deamorta6117 2 месяца назад
this is good
@LucaHofmann
@LucaHofmann 2 месяца назад
Thank you for the video! Two ideas to improve the code: 1) Make your jump_height value negative (e.g. -100) and remove the -1 multiplications from your calculations. 2) Rename jump_time_to_peak to jump_seconds_to_peak and jump_time_to_descent to jump_seconds_to_descent. Why? 1) Don't add the circumstance that in Godot Y -1 is UP to your calculations if you do not need to. Someone who edits the jump_height is most likely aware that -1 points up. No need to hide that fact. 2) It is nice to know the unit of the time by looking at the variable name. Someone who edits the variable does not have to guess.
@ThalesCardris
@ThalesCardris Месяц назад
Although I find this constructive, I think the first one is a matter of preference. I would much rather see positive values in my exports than having to add that - all the time.
@johnnobon
@johnnobon 2 месяца назад
I think this is the best video for getting the jump right, with it allowing you to control both the height and the time to reach the height. I think using the default gravity often slows down the jump too much as you reach the peak. One thing this doesn't do is allow you to "short" the jump by just tapping and letting go, or do the jump to full height by holding the button. I got this added in 3D using the following line under _physics_process(delta), and I think it would work in 2D if you reverse the signs: if Input.is_action_pressed ("jump") == false && velocity.y > 0: velocity.y -= 1 You can replace the velocity.y -=1 with whatever deceleration formula you want. You can also add a terminal velocity for your character by adding the following under your _physics process: velocity.y = clamp(velocity.y, -100, 100) replacing the 100s with whatever variables you want to use as the min and max velocity. This makes it so your character's fall speed will not increase indefinitely and eventually become constant. Otherwise you may find your character falling way too fast from big heights.
@Shuhkky
@Shuhkky 2 месяца назад
I know this is an older video so i probably wont get a reply, but if i move the menu anywhere other than the starting position, the cursor becomes wildly out of sync with the position of the menu. Leading it to "dissapear" but still being functional. Any help?
@Pefeper
@Pefeper 2 месяца назад
Are you using the global rect when you're setting the position of the cursor to the menu items?
@Shuhkky
@Shuhkky 2 месяца назад
@@Pefeper I'm using global_position for setting the position. No global_rect found anywhere
@Pefeper
@Pefeper 2 месяца назад
@@Shuhkky The property on control nodes should be rect_global_position. In any case it's hard to know what the exact issue could be without seeing your setup. Can you send some screenshots and a description on the github gist linked in the description?
@Shuhkky
@Shuhkky 2 месяца назад
@@Pefeper Just sent a screenshot and the script on the Github repository via a comment.
@DavidRycan
@DavidRycan 3 месяца назад
Spent an hour trying to figure out how to set up Raycasting, only to find this channel and have every question answered concisely and simply. Thank youuuuuuuuu and also I love your animations they're adorableeeeeeeeee
@SantaAzulCTZN
@SantaAzulCTZN 3 месяца назад
So, how do I make the jump forced into a single direction?
@Pefeper
@Pefeper 3 месяца назад
Do you mean in some horizontal direction? Like preventing the player from moving mid air?
@SantaAzulCTZN
@SantaAzulCTZN 3 месяца назад
@@Pefeper Something like that. I want the jumps to be like classic Castlevania or fighting games.
@Pefeper
@Pefeper 3 месяца назад
@@SantaAzulCTZN You'll need to check if the player is on the ground. CharcterBody already has a method for this (is_on_floor). If your character isn't on the ground, don't modify their horizontal velocity (velocity.x) at all in the physics update
@Gwen_Hemoxia
@Gwen_Hemoxia 3 месяца назад
OH MY GOD THANK YOU SO MUCH THE RESOURCESAVER IS SO UNINTUITIVE
@marleystar7856
@marleystar7856 3 месяца назад
Yin yin???????????
@OlmStatic
@OlmStatic 3 месяца назад
wonderfully creative video, and straight to the point. RU-vid needs more guys like you bro
@BrandonScott-zn9vl
@BrandonScott-zn9vl 3 месяца назад
For those doing this in 3D and your jump height is inconsistent: Make sure this line: [return jump_gravity if velocity.y < 0 else fall_gravity] Is now: [return jump_gravity if velocity.y > 0 else fall_gravity] Also just generally make sure you are applying negative values to velocity.y for gravity...not positive. One wrong sign will mess up the whole thing.
@dungeoncorporation
@dungeoncorporation 3 месяца назад
How could you get this ui to loop back to the top or right to left so you could cycle through menu lists easier?
@dungeoncorporation
@dungeoncorporation 3 месяца назад
Would you be down to make a turn based combat tutorial similar to Final Fantasy on the NES
@retexcrafted
@retexcrafted 3 месяца назад
i mean if you weant that just get rpg maker it works far better if you dont want to write the code yourself
@dungeoncorporation
@dungeoncorporation 3 месяца назад
@@retexcrafted does it work on mac? I dont want to use rpg maker because all the games made in it look the same, but it would be interesting to see how its code is set up
@retexcrafted
@retexcrafted 3 месяца назад
@@dungeoncorporation yes the newest rpg maker (RPG Maker MZ) works on mac I believe it is paid but its consistently on sale so that's that and have you played omori? that game used it so as long as your willing to make sprites it will be more than sufficient for making it look like its own thing. as for coding its pretty intuitive you wont need to code much but when you do its just basic Javascript
@Gibbonizer
@Gibbonizer 3 месяца назад
yeah... this doesn't work. Jump height is always off by a few pixels
@Perndoe
@Perndoe Месяц назад
Is there a fix for that
@DMasterAco
@DMasterAco 3 месяца назад
Good evening @Pefeper ! First of all, I wanted to thank for the tutorial, it really helped me out on creating the Pause Menu and part of the Settings Menu for the game im currently trying to make, and I wouldnt be able to have a stylish pointer if it wasnt for the help and knowledge that one could have through this video (my many thanks). However, it seems like, after I press the button assign for confirmation on the Resume Button, I bring up the Pause Window again without having to get the Menu back up again with the Start button, which means that while I hide the menu along the pointer/cursor, the cursor/pointer can still access to the menu and bring it back up again. I tried using the paused() function on the Pointer/cursor in an attempt to not only hide the Pause Menu and the Pointer/cursor, but to make the Pointer/cursor unable to be used unless the Pause Menu gets backed up to the screen by pressing Start/Escape, but that didn't worked. Any advice or tip to solve this(Make the Pointer/Cursor not able to Select a Label/deactivate it and activate it again) if I may ask? PD: I hope the week and overall, 2024, is going well for everyone.
@Pefeper
@Pefeper 3 месяца назад
I think there's a lot of ways you could solve this, but the simplest would be to keep a boolean variable on the cursor script named something like is_active. At the beginning of process(), check if it's false and, if so, return from the function before processing input. Then just set that variable to true when the menu is active, and set it to false when it's not
@DMasterAco
@DMasterAco 3 месяца назад
@@Pefeper Thank you very much! By creating a boolean variable and using an if conditional on process() function(if true, run the rest of the present code in process(), if false, pass) i was able to not let the pointer keep going down or pressing the buttons once the pause menu was hidden. I wouldnt be able to do it without your help. Thsnk you very very much Mr. :pray: Something mow im working on is to be able to fix some issues im having with the Settings Window, since once in Settings, if we press on Back button, it goes to Pause Menu yet, while it can detect us of pressing Setting Button, no longer it shows said Menu back up. But yeah, again...thanks...without your hell k wouldnt be able to fix this nor advsnce, i hope u keep having a fantastic week
@BeSerious.studio_official
@BeSerious.studio_official Месяц назад
have you fixed it?
@falfit.
@falfit. 3 месяца назад
How can i get a collision on the exit of a collider? Im trying to make accurate bullet penetration but i need to know when does the raycast leaves the collider that it first hit. So i thought relaunching a raycast at the collision point of the collider, just a bit inside it, in the same direction, but i cant make it detect when it leaves the collider? It seems it only detect entering a collider. How can i make it consider exiting a collider as a collision?
@anonymouskitten4715
@anonymouskitten4715 3 месяца назад
Besides saving and loading, can’t I do the rest with custom Nodes? What makes resources special?
@risingpheonix7740
@risingpheonix7740 3 месяца назад
I'm back again to talk about refactoring this to work specifically with Godot's inbuilt focus for control nodes. I noticed every control node can specify it's neighbours, so if you're making a bunch of controls and you don't want to keep track of numbers, but update using the Focus tab, you can grab the nodepath as a text string using focus_neighbour_DIRECTION. makes for some short code too, as below; extends Control @export var menu_parent:Node @export var current_lbl:Label @export var cursor_offset: Vector2 @onready var path_pre:String = menu_parent.get_path() @onready var new_focus:String func _ready(): set_cursor_from_focus(current_lbl) func _process(_delta): var new_focus_node: Node if Input.is_action_just_pressed("ui_up"): new_focus = path_pre + str(current_lbl.focus_neighbor_top).trim_prefix("..") elif Input.is_action_just_pressed("ui_right"): new_focus = path_pre + str(current_lbl.focus_neighbor_right).trim_prefix("..") elif Input.is_action_just_pressed("ui_down"): new_focus = path_pre + str(current_lbl.focus_neighbor_bottom).trim_prefix("..") elif Input.is_action_just_pressed("ui_left"): new_focus = path_pre + str(current_lbl.focus_neighbor_left).trim_prefix("..") else: return new_focus_node = get_node(new_focus) #print(new_focus_node.name) if current_lbl != new_focus_node: set_cursor_from_focus(new_focus_node) current_lbl = new_focus_node #prints("changed node: ", current_lbl) func set_cursor_from_focus(focus:Node): global_position = Vector2( focus.global_position.x, focus.global_position.y + (size.y / 2) ) - size/2 - cursor_offset
@scubedibap
@scubedibap 3 месяца назад
Great work, this helps so much!
@Lel37178
@Lel37178 4 месяца назад
just figured this out recently but in case anyone has this issue where the character teleports to the jump height rather than jumping normally, you just change: velocity.y = get_gravity() * delta to velocity.y += get_gravity() * delta this worked for me in a 3D game, idk if it does the same on 2D (itll maybe turn the jump into a really high jump so you might need to tweak the numbers a bit-) great video btw it helped me a lot!
@4per8
@4per8 3 месяца назад
i think thats because your supposed to set the velocity to jump_velocity and use get_gravity for getting the gravity
@Lel37178
@Lel37178 3 месяца назад
@@4per8 probably yeah. didnt have time to check it out but i agree that might has to do with it (im still quite starting to learn gdscript lol)
@Snapper-gaming
@Snapper-gaming 4 месяца назад
this sounds like a much better way to create composition, instead of using nodes which has overhead, you can use this
@fieldtrip2178
@fieldtrip2178 4 месяца назад
For those who are wondering, You can set custom resources as types in Godot 4.
@Apebek
@Apebek 3 месяца назад
I was looking for this comment. thanks!
@pipacombate393
@pipacombate393 4 месяца назад
Bro I wanted this but with walking/running action instead, I wanted to be able to specify how long until the character reaches max velocity and (after the player let go of the run button) how long until the character loses all its velocity
@edgarvas2108
@edgarvas2108 Месяц назад
for my game, i did this: direction is either -1, 0, or 1, depending on the state of the input axis for movement in the ready function, set accel_rate to be top_speed / acceleration_time, and the same with decel_rate and deceleration if direction != 0: velocity.x += accel_rate * direction * delta velocity.x = clampf(velocity.x, -top_speed, top_speed) else: if velocity.x > 0: velocity.x -= decel_rate * delta velocity.x = max(velocity.x, 0) elif velocity.x < 0: velocity.x += decel_rate * delta velocity.x = min(velocity.x, 0) move_and_slide()
@pipacombate393
@pipacombate393 Месяц назад
@@edgarvas2108 tysm bro🙏
@edgarvas2108
@edgarvas2108 Месяц назад
@@pipacombate393 ur welcome bro
@risingpheonix7740
@risingpheonix7740 4 месяца назад
Thanks for the tutorial! I took changing which container I was in as a home task with vboxes; if the cursor ever tried to move left or right, i'd move the Index of the current parent along one in an exported array that was arranged so that the 0th index was the left-most box. if there wasn't a box to the right, i'd jump back to the 0th index box. after that, if the cursor index was too big, i'd make it jump down to the child count -1 in the new parent. i'm sure there are more elegant solutions, but i doubt i'm ever going to need to jump between umpteen vbox/ hbox and gridbox menus just yet.
@Pefeper
@Pefeper 4 месяца назад
That seems like a good approach!
@kieunghiaduong4848
@kieunghiaduong4848 4 месяца назад
Is there a way to make the jump higher the longer you hold the key in godot, similar to the game Jump King?
@user-nx9yn3wq3u
@user-nx9yn3wq3u 4 месяца назад
Does this not work in godot 4 or is the syntax changed? After I name the new resourse it doesn't show up for me in new script