You found the secret corner
of the internet, where we gathered 14 godot trick that are really hard to find. We will cover everything from screentransitions,
to dropped inputs, useful plugins and little tricks that will make your life easier. Gathered by the great people of our community
or found by us, working on our game furcifers fungeon. That you now can and should wishlist on steam! Number 1: By the power of the viewport texture! You can quite easily get the current screen
into an image. Just get the viewport, get the texture, get
the data, flip the image and create a texture from it. It sounds convoluted, but you can copy it
and it is really really powerful. Look what happens when we apply a simple dissolve
shader to it. This is also how the typical flashbang effect
is made, just take a screen copy, make it brighter and fade it out. You can of course save this image and you
have a screenshot or make a digital photo album of the players funniest deaths. Number 2: The easy way to get filepaths
Nesi and Fire540 brought us this one: when you want to load a scene from code, you do
not have to type it out. Simply drag and drop it, you will get the
exact path. Number 3: How to scatter assets
When designing levels, there are things that need precise and thoughtful positioning. And then there is grass. Scatter comes in super handy, if things should
be scattered or chained like fence. It gives you a lot of flexibility, you should
definitely consider this plugin when you map large 3d scenes. Number 4: Richtextlabel effects
Some version ago, textlabels got super powerful. You can detect clicks to different parts of
the text, and then there are all the crazy bb-codes. Like the wave, tornado, shake, fade and of
course THE RAINBOW! You can quite easily make custom effects too. This might be worth its own tutorial, but
trust us, richtextlabels are insane. Number 5: Serious serialization
Most games need a save and load feature. And with Godot, it pretty easy to write variables
into files, if you use var2str to encode them. You just use it on a variable, and than write
the resulting string to a file. To load, just read the file and use str2var
on the result. If you donβt need the results to be human
readable, maybe because you do not want to read save files or just can not read, you
can get more compact results with var2bytes and bytes2var. This can save you a lot of space for writing
out large chunks of data. Number 6: How to create empty shapes in 3d
Sometimes you need a rectangle in your life. There are several ways to create simple shapes
in 3d such as the CSG nodes. If you want a frame, you can use CSG torus
for that and set its sides to 4 - or to 3 if you want a triangle. Make the inner Radius almost as big as the
outer radius to get a thin frame, and reduce the y scale to make it flat. Number 7: Many control nodes eat Mouse and
Key Inputs by default Just recently we added a highscore to our
game, and suddenly our combat seemed janky. Some inputs simply were dropped, no matter
how hard we pressed. This was because we detected clicks with unhandeled_input,
which is a good thing to do. However, this means that the input can be
eaten by things like RichTextLabels and Buttons. This can simply be changed with the Mouse
filter property. For textlabel the default is ignore, which
is fine. It will let the input through and not inform
the node. Rich text labels and buttons have the default
stop, which will inform the node and stop this input. This can create problems if you need the input
in other nodes. There is also pass, which will inform the
node but also inform the other nodes above it, which is really helpful. Number 8: How to disable the script template
When you open a new gdscript file this nice little template is prewritten for you. But at some point you understood how the process
function works and you do not need it any more. Simply set it to "empty". Or you set it to "no comments" and just get
a ready function, which is kind of neat. Number 9: 3d textures are compressed by default
If you ever noticed artifacts on your textures, check your import settings! Remember, the import tab is important. The 3D template imports textures as lossy
with a quality of 0.7. For some images, this is barely noticeable,
but sometimes you want it to look really clean. QbieShay pointed this out on twitter, you
should definitely follow her. Number 10: You can animate colors , even of
shaders Animations players are your best friend, you
can even use them to animate colors. You will get this cute preview,- how nice. If you have a custom shader and mark a uniform
as color, you can also interpolate it in that way. We just recently used this to make our background
change colors. Number 11: Use curves precisely
Curves are super powerful and convenient ...yadayadayada. Very flexible blablabla, even my grandma uses
them for her game "Trollator racer 666". But have you ever tried to get this thing
to make exactly what you want? It is fiddly to get an exact value. You can set the limits and hit it that way,
or you can edit the file directly. Thanks Affensind for the tip! Number 12: There is a modulo for floats
To get the modulo of two floats, you cannot use the % operator, you have to use the function
fposmod(). You can also wrap floats between a minimum
and maximum value with wrapf. Just wanted to let you know. Number 13: Talk to the operating system
Collin Visser pointed out that you can easily check if you are playing in debug mode. This is an easy way to enable developer cheats,
or extra debugging tools. On a similar note, you can ask if the game
is minimized by the user, and react accordingly for example by maximizing it. Number 14: Vector2 and Vector3 have many convenience
functions There are just a surprising amount of situationally
useful vector functions. You can calculate the slide of a vector given
a normal, which is a cool feature on its own. Snap a vector to a grid with snap. You can interpolate between two vectors - linearly
and cubic if you feel like it. You even have a modulo for vectors, which
i never though i would end up using - but used it just recently! This video is over, but you can watch the
other ones we made. Here is our devlog, and here are 13 things
you might not know, see you!
These videos are so helpful and rewatchable
amazing :)
This video will probably save me an afternoons' worth of work in the near future. Thanks!