Share your Godot tricks (or else I'll call your grandma)!
@sslaxx2 жыл бұрын
With what, a Ouija board?
@PlayWithFurcifer2 жыл бұрын
@@sslaxx If necessary!
@mvolkankarakas2 жыл бұрын
Prefer Police officer :)
@李亦淇Marisa2 жыл бұрын
press ctrl+k to comment a bunch of code
@AgnisNeZvers2 жыл бұрын
@@sslaxx I prefer the Luigi board.
@Theraot2 жыл бұрын
I have some trickery for you: You know that Godot does not have static variables? That means that your static func don't have where to store anything. Well, I have a solution: make a custom Resource, and a resource file, preload it in your static func and store your static variables there. But wait, there is more… You know that the scene tree is not available from a Resource? That is because - unlike nodes - resources are not in the scene tree. So what if you want - for example - to access an autoload from your custom Resource? Well, use the get_main_loop method from the Engine singleton. That will give you a reference to the MainLoop instance, which - by default - is your - main - SceneTree. Oh, and by similar means you can access the SceneTree form your static func. So if you have been passing a reference around to be able to access these form your static func or Resources, you can refactor that.
@Relivino2 жыл бұрын
Why would you use static vars/funcs tho?
@Theraot2 жыл бұрын
@@Relivino Mostly helper methods. In particular for operations that the Godot API does not have. They would logically belong to a built-in class. Which I can't modify without making a custom build of the engine. And remember that we can't make extension methods in GDScript. So I make a class called along the lines of WhateverHelper where I put static methods which take whatever they need to operate on as parameters. And why an static method might need variables? For cache, memoization or lazy initialization. In other words: the static method needs to compute or instantiate something to work, and not having to do it every time is a reasonable optimization. Anyway, I'm NOT saying we should make everything like this. Not at all. But if somebody is in a situation when they do, perhaps they can find useful what I posted.
@Theraot2 жыл бұрын
@Gary Oh good. And that would cover most cases, actually. So using a resource would be strictly for baking data form a tool script, I think.
@Theraot2 жыл бұрын
@Gary After trying to put that in practice, I have couple notes: - I lose type safety. - I can export vars from the resource for easy configuration.
@lyingpancake952 жыл бұрын
That shatter particle effect is exactly what I've been looking for. Thank you!
@PlayWithFurcifer2 жыл бұрын
Amazing! :)
@dreamhive3d Жыл бұрын
I was having this exact problem with a timer continuing during the game being paused, and it was causing a situation where if a player died, then quickly paused, a player object would respawn even while paused. Thank you so much for this.
@Theraot2 жыл бұрын
I had not considered using modulate like that. Now I can rewrite my hue rotation shader to use modulate.
@L4Vo52 жыл бұрын
I wish scene tree timers also had a parameter to run on physics process. that would be so useful. That modulate stuff is really clever!
@JosephCatrambone2 жыл бұрын
This is one of the most useful videos you lot have made. (For me, at least.)
@PlayWithFurcifer2 жыл бұрын
Great to hear that! :)
@hamoom2 жыл бұрын
that exploding sprite thing is very cool. wouldn't have thought of that
@PlayWithFurcifer2 жыл бұрын
Glad you like it. It's one of these fun little hacks that can come in handy sometime :)
@DjPerception912 жыл бұрын
Some really great stuff guys, constanly getting some juicy info here! Thanks! Any chance there is a Video on a good way of making top down trails on water?
@PlayWithFurcifer2 жыл бұрын
Thank you! What do you mean exactly? Maybe you can just use a particle system that you turn on when the player is in water? (particles in global space so they make a trail)
@DjPerception912 жыл бұрын
@@PlayWithFurcifer I was thinking of some sort of a simple wave function. A shader, but i think i have another solution. The actual problem i have is, as funny as it sounds, the z index. I have a whole lot of layers for the background/floor and usually my complex water objects land on top, not behind them. So the particles cant be cast between the floor and the water layer, ending up on top of water borders from time to time. So i thought about an additional layer/s with some sort of wave function shader for a trail. I will test another solution soon and might inform you on how it worked out if you wish.
@RaveYoda2 жыл бұрын
Very nice! I love getting these tips!
@PlayWithFurcifer2 жыл бұрын
:)
@ghaydn2 жыл бұрын
I love your sense of humor.
@PlayWithFurcifer2 жыл бұрын
Thank you! :D
@Siberiius2 жыл бұрын
You save me so much time. Great videos!
@sandsandwich2 жыл бұрын
these videos are exactly what I need thank you!
@PlayWithFurcifer2 жыл бұрын
:)
@Tenraiden11 ай бұрын
That girl grabbing the money flying out of the bag, where is that clip from? 0:09
@PlayWithFurcifer11 ай бұрын
Probably pexels if it looks like stock footage
@AudioBoi1 Жыл бұрын
the tests show awesome results, thank you for this ❤
@Galomortalbr2 жыл бұрын
yield(get_tree().create_timer()) is a safety hazard and honestly should never be used. for any poor fella who try to use this thing on your project, the likely hood of this causing headache is massive, please just generates regular timer nodes.
@thenapoleonlover1132 жыл бұрын
More videos like this please! :)
@PlayWithFurcifer2 жыл бұрын
Oooh, for sure :D For the meantime: Have you seen all our other tricks videos already?
@dsfdsdiaz99522 жыл бұрын
Thank you guys for this video! I was using an algorithm to break my sprite into many objects. The issue is that it can get laggy... I´ll use this method instead. Though I did not understand why you added an animation at the end. ( I am noob and I would just emit the particles once). Regards!
@PlayWithFurcifer2 жыл бұрын
There are many ways to achieve a break/dissolve effect, maybe this one works for you! I made an animation to quickly fade out the underlying sprite, but you can also just switch it to invisible and emit the particles.
@digitalman21122 жыл бұрын
Awesome! Great Stuff!
@PlayWithFurcifer2 жыл бұрын
Thanks!
@Gazaze2 жыл бұрын
The modulate trick is gonna solve my shaders problem! thank you!
@PlayWithFurcifer2 жыл бұрын
Amazing! :)
@Phlip45 Жыл бұрын
I just found out if you change the icon.svg file in your project, that icon will be the one that shows in the project manager. Fun stuff
@SmeddyTooBestChannel2 жыл бұрын
oh my god that create_timer thing makes me feel like an idiot. i always kinda felt that cluttering a node with timers was kind of an ugly looking thing so to know that there's been a code-based workaround for that is both relieving and irritating.
@realMenta2 жыл бұрын
Thanks for the useful tips!
@PlayWithFurcifer2 жыл бұрын
:)
@mgomezmunoz92 Жыл бұрын
So the thumbnail says do not create a get_tree(). create_timer() but on 0:26 so say the opposite?
@andreamassa21762 жыл бұрын
Thank you very interesting and useful trick!
@badunius_code Жыл бұрын
Never had to use a scene tree timer, for me it's either signals when I need to wait for an animation or tween to complete. Or a variable that I update in _process when I need to do something periodically. It also allows me to randomize periods, make them dependent on circumstances or reset them prematurely.
@ivailoburov12952 жыл бұрын
If you use in your code any non defined actions in project settings your FPS will drop to several FPS per minute. :D There are not any error messages as far as I remember. This occurs often when transferring parts of the code from one project to another. Do not use this trick. :D
@PlayWithFurcifer2 жыл бұрын
Huh, thats weird
@rocket0072 жыл бұрын
i always laugh when you say "like animals". =D
@miserablepile2 жыл бұрын
I love these videos
@PlayWithFurcifer2 жыл бұрын
@josecarlosbermudezcastro26172 жыл бұрын
Amazin vídeo, is really helpfull, tnx
@PlayWithFurcifer2 жыл бұрын
Thank you :)
@Relivino2 жыл бұрын
For particle explosions, is there a way to randomize the shape of the pieces as well? In many cases, the "all-square-pieces" don't produce a very appealing result.
@quinndepatten44422 жыл бұрын
That spunds like theres a little particle shader wizardry involved.
@PlayWithFurcifer2 жыл бұрын
You can mask it with another texture using a fragment shader
@Relivino2 жыл бұрын
@@PlayWithFurcifer Like here? kzbin.info/www/bejne/m4Wcq6ehfJeDirc
@hamoom2 жыл бұрын
@@PlayWithFurcifer Can you describe a little more on how to do this? I cant apply a second pass shader.. Do I need to convert the particle to a shader and work from there? I'm trying it out but particle shaders dont have UVs so cant figure out how to use a sampler2D to mask them.
@AdamsAGD Жыл бұрын
how did u guys make your coins bounce in your demo? ive only been coding for a month and cant even find a place to start. Did you do it with code or a shader or something else?
@PlayWithFurcifer Жыл бұрын
More or less just an animation player :)
@AdamsAGD Жыл бұрын
@@PlayWithFurcifer yea but i see them bounce off in different directions... you must add some kind of code or perhaps have a bunch of animations for all those directions? anyways tnk for the respond.
@beidero2 жыл бұрын
For unique input to the same shader through uniform why do you need to make multiple shaders? Can't you just check "Local to scene" (under resource) in the inspector for the shader. I created a tilemap shader that I dynamically instance copies of and send different parts of the map this way. Or did I misunderstand something?
@PlayWithFurcifer2 жыл бұрын
We said that you can make it unique. So yes, making it local to scene works BUT this internally makes multiple materials which prevents batching.
@diegomultimidia2 жыл бұрын
haha i will love to watch this video but the thumbnail is something i have discovered for myself because sometimes the object is not there after the timeout.
@PlayWithFurcifer2 жыл бұрын
Haha yup, we also rarely use yields in general. A typical function connect (with CONNECT_ONESHOT if needed) is safer.
@paulosullivan34722 жыл бұрын
Okay that call_group command is great how did I not know that before?
@PlayWithFurcifer2 жыл бұрын
We also just found it, i wonder when it will come in handy :)
@paulosullivan34722 жыл бұрын
@@PlayWithFurcifer I have already found a way to use it in the game I am making! It helped me solve a problem with communicating between groups!
@shanefoster530510 ай бұрын
OK OK I'll Like! PLEASE DON'T CALL MY MOM!!!
@InarusLynx Жыл бұрын
Does anyone know how to add auto-complete for functions I write? I made some global functions and put them into autoload, but I have to always look up how I spelled them. It never suggests the functions I wrote inside of the global script.
@hilfazer2 жыл бұрын
And i thought you guys were going to talk about the perils of yielding from _ready() :D
@PlayWithFurcifer2 жыл бұрын
Which one exactly? :D It deservs its own video honestly
@hilfazer2 жыл бұрын
@@PlayWithFurcifer 'ready' signal is emitted either with return or... with the first yield. If something connects to that 'ready' and relies on _ready() function having done all of its work... well, it won't go well. Creating a custom signal and emitting it at the end of _ready() is an option but one needs to remember to connect to that signal instead of 'ready'. Not ideal.
@UsernameDoesntCare2 жыл бұрын
Ive been having a bug with SceneTree Timers where if I change a scene in the middle of one, the game will produce an error but still run in debug mode. To fix this, I had to make my own timer nodes.
@Willior472 жыл бұрын
same here. i swore off SceneTree timers forever after this.
@covenautadev72602 жыл бұрын
I don't know if this is already in a video, but probably I have invented it, STOP using get_node("Path"), I hate it because when you change the path on files/tree or the object is deleted in-game it gets errors, instead, I create a var for example "Player" on the main global script "GS" then on node's ready call I set var to itself. extends KinematicBody func ready(): >>> GS.Player = self In that way, the path doesn't matter and if the player is deleted on death it is replaced automatically when you instance another because it is on ready(), note: if you want to use "Player" but the node hasn't called to ready you need to yield a frame.
@PlayWithFurcifer2 жыл бұрын
Interesting, thank you! :)
@KyleLuce2 жыл бұрын
Lol @ photo cuts to Juan in Barcelona. I hope he watches these.
@PlayWithFurcifer2 жыл бұрын
Haha, I don't think so but it would be hilarious
@SaiponathGames2 жыл бұрын
Nice!
@PlayWithFurcifer2 жыл бұрын
Thanks!
@danieltudor942 жыл бұрын
one thing im curious about is who has the 1060 and who has the 3080 ?
@Galomortalbr2 жыл бұрын
i had no idea about call_group, this seems so useful.
@netyimeni1692 жыл бұрын
Oh the timer
@gines62342 жыл бұрын
First comment! :D I love you guys!
@PlayWithFurcifer2 жыл бұрын
@yell91402 жыл бұрын
👍👏
@SYLegendOP Жыл бұрын
vulkan errorororoororororororoororororororo😢😢😢
@muerasangre2 жыл бұрын
👍
@Shiromaru. Жыл бұрын
I really liked your content but i unsubscribed because of flag
@PlayWithFurcifer Жыл бұрын
That's one of the advantages of that avatar :D Your need to let me know confirms that you are quite the asshole.
@duducorvao2 жыл бұрын
I have a problem for you guys to solve, since I tryied the Godot Discord channel and even the subreddit but could not solve it: My game is ready do be published on Google Play Store, but I can't upload it because, since the beggining of this year, Google only accepts .AAB files no larger than 150mb, but my game has lot of big textures and Godot exports it as a 600mb .AAb file. Reading in the Android's documentation, I see they have a new way to upload those big apps called Play Asset Delivery which has 3 types of "upload": install-time (this is like it was before with apk, but being .aab files. Just one 150mb file), on-demand (your game downloads all the heavy assets after installing the game) and fast-follow (this got me a little confused, but I think is when you split your app in several 150mb .aab files and upload eachone to the store). I don't know if I'm understanding this right, but seems like Godot right now only has support for the install-time method, which is a bummer, cause this limits a game to only 150mb :( This is my first commercial game, and me and my really small team worked 18 months on it. We know it's not the greatest game, but we would like to publish it. Thanks for reading this.
@DileepNow2 жыл бұрын
Maybe this is common knowledge but I found out a godot thing today. Say you have an area and monitoring was set to false for some reason. Now if you set monitoring to true to detect something, it will not emit 'area entered' signal for monitorable areas that are already intersecting the monitoring area. But if you want to get that signal, just give a zero translate to the monitoring or monitorable area right after you set the monitoring to true. Like $monitorArea.monitoring = true, followed by a $monitorArea.translate(Vector3(0,0,0)). Edit: This is in Godot 3.4
@MikeOlaoye2 жыл бұрын
GODOT is hard but y'all make it look easy 👍 Love the video, don't call my mum 🥲
@PlayWithFurcifer2 жыл бұрын
Ok, we wont :)
@nickhatboecker2 жыл бұрын
CONNECT_ONESHOT was a game changer for me!! Thank you very much