BackAt50Ft · @BackAt50Ft
341 followers · 8 posts · Server mastodon.social

I forget if I mentioned this before, but it's an important : if you find yourself awaiting or yielding ready on a parent node in your child node, DON'T DO IT! Instead, just have your parent node tell the child to do whatever action you had been doing previously, rather than doing it in _ready.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
323 followers · 208 posts · Server mastodon.gamedev.place

: I guess I should just start a little github repo with scripts like this. This is KidsCanCode's camera shake code all in one place! (Currently his site is broken so you can't get it all at once.)
gist.github.com/WolfgangSenff/

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
320 followers · 199 posts · Server mastodon.gamedev.place

A fun for tonight:

Have you heard of capture tracks?

A capture track in an AnimationPlayer will animate from the current value of a property to the value in the first keyframe.

Say you have a sprite that was on a Path2D and you don't know where the sprite is when the animation starts, but you need that sprite to get to the center of the screen over time: Make a capture track, move your key to a few seconds in, and no matter where the sprite started, it'll end up where you want it!

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
313 followers · 179 posts · Server mastodon.gamedev.place

Following Masahiro Sakurai's advice, I've put all my data for my latest Godot game into one place where it can be edited extremely fast. This has made my life so much easier, it's bonkers. Testing never felt so good!

#godottips #godotengine

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
308 followers · 167 posts · Server mastodon.gamedev.place

Been a while since a : a sweet, new, little utility function on arrays in Godot 4: pick_random(). It picks a random element for you and returns it. Much easier than shuffling the array and taking the first!

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
305 followers · 161 posts · Server mastodon.gamedev.place

: Use Texture Padding often breaks things in the new TileSet editor for 4.0. This is a sort of negative tip, in the sense the overall feeling is more negative, but it's just one of the things that can easily break your TileSet, so make sure to try unchecking it before you do anything else - it may be as simple as that to fix your issue! (It's found in the TileSet editor under the Setup tab, under the Atlas.)

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
300 followers · 157 posts · Server mastodon.gamedev.place

: Courtesy of KoBeWi from the Godot team: github.com/godotengine/godot-d

A list of poorly-documented or easy-to-miss...tricks!

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
272 followers · 133 posts · Server mastodon.gamedev.place

Ah-ha! A second in as many minutes (appx): With the latest betas of Godot 4, sometimes you will find your solution which had been working previously crashes even before it opens. If that happens, try deleting your .godot folder in the project's folder and then reload it! Sometimes, in betas and alphas, things will get flummoxed, as upgrade paths and stuff may change, or import options and shader-related settings. Blowing away the .godot folder will essentially rebuilt everything.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
272 followers · 132 posts · Server mastodon.gamedev.place

- often, you will want to create systems that are well-decoupled so that you _know_ bugs aren't happening from their interactions. This isn't just for Godot, but I recommend creating an entire, separate project to test stuff in and make sure it works exactly the way you want, before importing it into your main project! It's a lot of work, but it's worth it in the long-run, in my opinion as a developer of over 15 years.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
265 followers · 121 posts · Server mastodon.gamedev.place

: Here's some new things in Godot 4.0: add_sibling() is a new function that makes it so you can add a sibling node very easily rather than only child nodes (this also makes it so you don't have to go to the parent and call add_child() from a child node). There's also "internal" nodes, which are prevented from being seen in get_children() and get_child() unless you specify otherwise. This is so tools/addons can hide internal, vital nodes so users don't accidentally break things!

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
260 followers · 116 posts · Server mastodon.gamedev.place

: Not strictly for actually, but this guy is amazing and you should watch all his vids! youtube.com/@sora_sakurai_en

See my follow-up message for a quick snippet of Godot code to help you out!

#godotengine #godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
260 followers · 113 posts · Server mastodon.gamedev.place

I only just noticed today's ! It turns out in 4.0, there's a new function for groups you can call on the scene tree called get_first_node_in_group("GroupName")! This is very useful, because most people are new to using groups, and often don't realize the only way to do it before, get_nodes_in_group("GroupName"), returned an array, so required you to index into it and take the first one if it existed. This is much cleaner.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
258 followers · 109 posts · Server mastodon.gamedev.place

: Understand the Asset Lib! It has a huge number of excellent addons that can help you develop your games and applications much faster than normal. Many don't even require too many changes! I recommend Godot Firebase, but then again, as its author, I would. :P

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
240 followers · 97 posts · Server mastodon.gamedev.place

: I'm super-surprised to find I haven't mentioned this one yet, but you should be highly reliant on the scene tree for logic! In the past, even I had at times gone too far in the direction of resources, i.e. "nodes without a visual component", but then exported a PackedScene on those resources. In my more recent experience, that's a mistake, a bad one; if you're going to have a scene at all, use a node for it instead, and have a parent with a bunch of children that get interpreted.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
232 followers · 86 posts · Server mastodon.gamedev.place

: Use call_deferred when you're in the middle of a physics frame and need to change the physics state! If you're adding a child or changing some physics value, call_deferred is absolutely necessary to prevent the system from going haywire.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
228 followers · 83 posts · Server mastodon.gamedev.place

of the day: when working with the beta, save often. Also when working with stable. Just always save often, darnit! Made 28 tilesets tonight and it crashed before I could save even a single one of them.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
203 followers · 70 posts · Server mastodon.gamedev.place

: Today's tip is brought to you by scripts! Scripts allow you to cleanly design your game so that you don't have to have a node call directly into the internal nodes (for instance) of another one in order to change or set values or functionality. So don't be afraid to add a script to a node, even if it seems like a weird place for one! Give it the functionality you want it to have and lock up your API tight, so you don't accidentally make your game super fragile to change.

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
199 followers · 67 posts · Server mastodon.gamedev.place

: have trouble with nodes being queue_freed but you still have signals connected to them?! This common problem has an easy solution and a harder but possibly more "correct" solution! First, you can use the function `is_instance_valid(node)` to determine if a node is valid for use. This is easier, but is sort of a work-around. You can also hide a node, disconnect all signals, then queue_free it instead, the longer but debatably more correct approach!

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
177 followers · 62 posts · Server mastodon.gamedev.place

: @akien sometimes publishes a beta before the blogpost is ready, and you can find Godot 4.0 beta 5 here: downloads.tuxfamily.org/godote :D

#godottips

Last updated 3 years ago

Kyle Szklenski · @BackAt50Ft
174 followers · 58 posts · Server mastodon.gamedev.place

: Areas are really the most useful node. You can have multiple per parent to pick up different types of collisions, and just set the physics layers correctly and they won't interfere with each other. Understanding the physics layers will help you understand all of Godot itself.

#godottips

Last updated 3 years ago