Godot Tips I Wish I "Node" Sooner

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thank you very much for this! Despite me using most of those already, I wish more people would share these eyeopening moments. There is always one or the other little thing that can improve your daily experience so much. For instance I was not aware about clicking the # in the color picker would give me Color() code I just could paste into my script. Very useful!

About tip number two, the connected resources by default, I actually think this is not right and should be changed:

https://github.com/godotengine/godot-proposals/issues/317

👍︎︎ 5 👤︎︎ u/golddotasksquestions 📅︎︎ Dec 18 2019 🗫︎ replies

Hey, that was great! If you gather more of these, especially in code (like the placeholder thing), please make a follow-up video!

👍︎︎ 2 👤︎︎ u/VRbandwagon 📅︎︎ Dec 18 2019 🗫︎ replies
Captions
so today I'm gonna go over a handful of Godot tips that I wish I knew sooner and I felt rather stupid for not knowing them but they were completely mind-blowing in the moment when I finally realized I hadn't been using them and if you like this type of content please subscribe and let me know in the comments so first off the inspector does math for you you can multiply and divide things right in the inspector also you can duplicate nodes with the ctrl D but if you duplicate things that have a resource like a collision shape has a shape resource they will be connected and you'll be changing both of them unless you go over to that resource and make it unique so when you have a sprite you can easily put a sprite sheet in the texture and just change the amount of frames that it has to get the image that you want but I've always found this very difficult in the texture rect to do the same thing you have a texture here but there's no animation tabs to zoom in on exactly what you want so what you need to do is actually use the atlas texture which is basically using a region of a texture and then you can decide what you actually want to keep don't forget to click expand so when you have a ray cast make sure you always enable it if you want it to do anything and also ray casts work really well when they start outside of a collision area and go into it like that but they do not work that well when they are already inside of the collision when doing with the color tab don't forget that you have this droplet thing to pick up a color from wherever you want you can pick up the green or you get the black so you can get exactly the right shade that you want also when dealing with the color you have this button here that will switch from this six digit identification to the RBG normalize it at numbers which you can copy and paste and then put into your code now when doing with the script you can always ctrl + or ctrl - to zoom in you can also use ctrl K to make commented or uncommented you can grab entire sections and tab them over or shift-tab them back when you want to make a nice readable list you can always tab over to the next tab and then you can tab up to it and continue to make a very readable list so whenever you have a pattern like this where it's just the number changing it's really easy to use placeholders to shorten this up so you don't have so much garbage to look at and what this set get function returns is just a simple number so we should be able to easily get it integer back now unfortunately these start at 1 so I will have to add 1 to my string which I'll show you in just a second instead of making this silly array that is completely unnecessary we can use this placeholder so I took the last digit of these off and I put the % s which will be be replaced by what's after this % and we'll take the texture and like I said it starts at 1 instead of 0 so we need to add 1 now this works great up until 10 where the if you have 10 it'll make this into a four-digit number so what you can do instead of having just this you can erase both those zeros so now we're going to replace this whole digit but when you have 1 it won't put zeros in there unless you add pad zeros this will return three numbers every time and if it's only 1 it will go 0 0 1 and if it's 10 it will go 0 1 0 so with placeholders I also found it nice that you can put the placeholder into a string and then add the variable to it later so I make this string and then I call upon it in this other script where I decide randomly how many items I'm going to actually need and I can end up with this string right here the last thing is match statements are a lot more flexible than I thought they were originally you can match multiple things into one category so this is saying if it's a 0 1 or a 2 now if you put those in an array it's going to be looking for exactly that array you're looking for an an array with a 0 1 and a 2 in it but if you don't put it in an array you can just have it look for any one of those digits and you can also use it with strings U which is the same story if you were to put this in an array it would look for an array with exactly person and cat without the brackets it could be either a person or a cat to match so in the comments let me know if you have any of your own mind blowing moments of simple things that you should have known
Info
Channel: Gingerageous Games
Views: 21,519
Rating: undefined out of 5
Keywords: Godot, 3.1, Tutorial, Tips, Trick, Help, Game, Development, Mind, Blowing, Beginner, Advice, Learning, Coding, Gdscript, Unique, textures, match, comments
Id: wPFaFPq16Yo
Channel Id: undefined
Length: 5min 12sec (312 seconds)
Published: Tue Dec 17 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.