Save Countless Lines of Code With Animations in Godot

  Рет қаралды 86,217

GDQuest

GDQuest

2 жыл бұрын

Get the 4 free Godot Node Essentials guides: www.gdquest.com/node-essentia...
You can get Godot Node Essentials at a combo discount with the Learn to Code From Zero course on Kickstarter (only until October 31): kickstarter.com/projects/gdqu...
---
👥 CREDITS
Host: @Bramwell Williams
Video edited by Nesi: / nesiawesomeness
Godette design CC-By 4.0 Juan Linietsky and contributors
---
💌 JOIN US
Come chat on Discord: / discord
Follow us on Twitter: / nathangdquest
---
📝 CC-BY LICENSE
This video is licensed under the CC-By 4.0 license: creativecommons.org/licenses/...
You can attribute it to "CC-By 4.0 - GDQuest and contributors - www.gdquest.com/"

Пікірлер: 90
@ishdx9374
@ishdx9374 2 жыл бұрын
genius, i always thought there was something i was doing wrong when i had several timers and tons of deltatimes, i didn't know animation players could call functions, awesome stuff
@Fredo22
@Fredo22 2 жыл бұрын
Fellow deltarune fan
@whiplasher1599
@whiplasher1599 2 жыл бұрын
If you were using those timers just to pause your scripts for a little bit you can do the same thing in a single line of code by using the yield function and creating a timer within it
@ishdx9374
@ishdx9374 2 жыл бұрын
@@whiplasher1599 that would block though, it gets more cumbersome if i need more animations running
@dugtrioramen
@dugtrioramen 2 жыл бұрын
@@ishdx9374 you could just put the yield in a separate function, and that function would yield instead of the main one. But animation player is still better
@industrialdonut7681
@industrialdonut7681 2 жыл бұрын
@@whiplasher1599 that is disgusting
@helianthe3457
@helianthe3457 2 жыл бұрын
YOU CAN DO THIS BY ANIMATION???? This is a game changer ngl. Thank you!
@aurorapaisley7453
@aurorapaisley7453 8 ай бұрын
hehe.. a game changer
@giggling_stars
@giggling_stars 2 жыл бұрын
Me, an animator: Wonderful! Time to make an entire game with just animations
@BlenderKiel97
@BlenderKiel97 2 жыл бұрын
Animation system in Godot is crazy! I had no idea it is capable of such things!
@Theraot
@Theraot 2 жыл бұрын
This was there when Godot went open source. It was never news, so it is rarely covered.
@BlenderKiel97
@BlenderKiel97 2 жыл бұрын
I know but man it's much better than I imagined
@noxen1402
@noxen1402 2 жыл бұрын
We can call functions in animations ?! You just changed my coding life! Thanks for all the great videos!
@UsaraDark
@UsaraDark 2 жыл бұрын
I've always had some pride when I did animations completely through code, but the fact that you can fine tune the timer is extremely powerful. I messed animation player once in the past, and although a bit tedious to setup, it's so easy to mess with once done so.
@igorthelight
@igorthelight 2 жыл бұрын
About pride when you write your own - that's a common thing for programmers :-) You could still write your own modules in Godot. Or just look at sources so you could know how it works.
@tucutaca2010
@tucutaca2010 2 жыл бұрын
I wish I had this video back when i didnt know about animations. This can dramatically speed up your workflow if you tend to do anything by code
@sterlingsteele1394
@sterlingsteele1394 2 жыл бұрын
Omg THANK you for this, I made like 3 whole scenes to just to spawn different effects for the bullet, to keep the sound going, etc, omg ty for this. I am like 2 weeks new to Godot, so this is huge for me.
@paulsullivan649
@paulsullivan649 2 жыл бұрын
Wow. Had no idea you could do so much via animations. 100% spending my evening reworking at least 3 different areas of my game to use this technique. Thank you!
@crabscrabscrabs
@crabscrabscrabs 2 жыл бұрын
this is one of those things that felt like cheating when i first discovered it, i always assumed there was some unspoken reason to not rig things up through the animation player, but i suppose not! makes me feel a lot better about the "jury rigging" i did to make things work.
@chacelow2438
@chacelow2438 2 жыл бұрын
Just yesterday I was playing around with this idea and started writing my own simple property animator in GD script. Thinking animations were something that only came prepackaged in 3d models. Thank you so much for making this video. Bonus points, it's concise, you're well spoken and you offer helpful examples! Would be great to see if there's any overhead to this approach vs just coding the transformations? When to use animations/animation controllers vs when it's better to code it into the script.
@elrelster
@elrelster 2 жыл бұрын
Mmm this was incredibly insightful, signed up for the free guides. Quality content fellas
@PedroBrandesitsme
@PedroBrandesitsme 2 жыл бұрын
Wow, here I’m chocked again about how easy godot is! Thank you
@Kaedric999
@Kaedric999 2 жыл бұрын
Well I've been mulling over whether to pitch in to the kickstarter and I'll let you know that this video pushed it over the line. Had no idea you could do that stuff, hopefully there's other neat tricks in the course :)
@idle.observer
@idle.observer 7 ай бұрын
As always, great video, thank you!
@jayarrow4274
@jayarrow4274 Жыл бұрын
It's incredible how powerful animations are in Godot. One drawback, in my opinion, is that the code is less readable when you outsource a lot of logic to animations.
@peatral
@peatral 2 жыл бұрын
The moment I found this out a year ago (or so) I knew instantly that this is the most powerful feature of godot. Animating function calls, audio, literally every exposed variable, that is just crazy.
@thomasmaier7053
@thomasmaier7053 2 жыл бұрын
Nice format, nice and short and useful.
@CyberVi7a
@CyberVi7a 2 жыл бұрын
Holy hell I had no idea. This is amazing!
@bwah9481
@bwah9481 5 ай бұрын
Such a powerful tool. Thank you
@datmantj7
@datmantj7 2 жыл бұрын
Animations is going to be a extremely huge game changer!
@frankhuurman3955
@frankhuurman3955 2 жыл бұрын
Dang this is a gamechanger, amazing!
@selgesel
@selgesel 2 жыл бұрын
Oh wow this changes everything. I've always felt that object lifecycles should be tied to the animations, and I've had numerous shower thought sessions thinking over generic solutions but failing to come up with one. Turns out it was right in front of me!
@Chevifier
@Chevifier 2 жыл бұрын
Ive been using this method to animate Shaders for a while now and calling functions for hack and slash type games combo follow up attack system.(i.e have a function that resets a combo attack if the player hasn't pressed attack for the next chain attack)
@pianoatthirty
@pianoatthirty 9 ай бұрын
This is nuts.
@soundrogue4472
@soundrogue4472 10 ай бұрын
This is cool for those who want to code less; I'll consider this if I want to code less.
@simeontodorov9353
@simeontodorov9353 2 жыл бұрын
This is so clever!
@igorthelight
@igorthelight 2 жыл бұрын
You could also connect Signals in Editor, saving another few lines of code. All of that is still code - but it's under the hood now. But it's more clean that way :-)
@asdaaaaaaaaaaaaaasd
@asdaaaaaaaaaaaaaasd 2 жыл бұрын
life changing
@Speed-TV
@Speed-TV Жыл бұрын
0:01 save of
@alexguy7395
@alexguy7395 2 жыл бұрын
This is really cool, time to make an open world mmorpg using the animation player
@industrialdonut7681
@industrialdonut7681 2 жыл бұрын
This is a really cool tip, but what about testing or previewing it in the editor? Like, I don't think the functions get called when you preview the animation in the editor
@NexusBaum
@NexusBaum 9 ай бұрын
super useful for meelee combat 🤔
@zhengistasbolatov8480
@zhengistasbolatov8480 2 жыл бұрын
Exactly, my codes lines would be 3-4 times more if I didn't knew about method call track in Animation Player
@punkysuen
@punkysuen 2 жыл бұрын
It is super neat solution. But, would it be easier to reuse Animation Player Scenes on other project by code?
@Wuskus
@Wuskus 2 жыл бұрын
This is some black magic right here
@angulinhiduje6093
@angulinhiduje6093 Жыл бұрын
hey @GDQuest, is this still up to date with Godot 4x?
@MrEliptik
@MrEliptik 2 жыл бұрын
I really need to use the Animation player more!
@anastasiaklyuch2746
@anastasiaklyuch2746 2 жыл бұрын
hmm i have an animation question: I have a 2D skeleton body (to animate a character made of bodyparts) and I want to make two such characters embace in an animation, which means some of limbs of one character go behind the second character and others go on top of him. How can I define such layering of bones between characters?
@Thomahawk1234
@Thomahawk1234 2 жыл бұрын
I'm not sure I understand correctly but I think you're looking for the z-index of your sprites or textures. Unless you're talking about 3D stuff. I'm not very familiar with 3D.
@Theraot
@Theraot 2 жыл бұрын
I'm not sure I understand the problem. However, perhaps the solution is in using remote transform nodes. Try that.
@anastasiaklyuch2746
@anastasiaklyuch2746 2 жыл бұрын
@@Thomahawk1234 z-index can be used in 2D animations? Cool, thanks :)
@anastasiaklyuch2746
@anastasiaklyuch2746 2 жыл бұрын
@@Theraot Thanks, I'll look into that :)
@nerothos
@nerothos 2 жыл бұрын
Yeah figuring out I could scroll my entire level by simply using an AnimationPlayer node kinda blew my mind.
@whoeverofhowevermany
@whoeverofhowevermany Жыл бұрын
When I'm already 30,000 lines of code in 15 doesn't even feel worth mentioning
@thomasmaier7053
@thomasmaier7053 2 жыл бұрын
What the hell? This is spot on, cheers mate!
@realadnoh
@realadnoh 8 ай бұрын
Sorry buddy, but I'll steal this information for my unreal development ;) didn't even thought about putting also game logics inside the animation/sequence - but it makes conversation with artist a lot easier for me as a developer I think
@nanotross537
@nanotross537 2 жыл бұрын
Let's say you have a projectile that either splits up after a delay, or that can hit multiple times inside an area as it passes through (like piercing ammo in Monster Hunter). Would this be simpler with code or by making the animation call a function that creates more projectiles? Do animations support conditionals? If not then you'd have to call a function that does the branching logic for you and have that spawn more projectiles.
@Gdquest
@Gdquest 2 жыл бұрын
You don't have conditionals so in that case you may use only code or a mix of animations and code. If the bullet needs to do multiple things on impact, you could use an animation just for the impact. You could also get things like making a single bullet scene with different animations for the different kinds of bullet impacts, allowing you to group them all in one place. From code, you'd just have to play the right animation. But yeah it really works only when you have to do a fixed set of things and it involves time.
@jonathancamarena3117
@jonathancamarena3117 2 жыл бұрын
neat
@ferdeboergd256
@ferdeboergd256 2 жыл бұрын
Really cool and useful! And maybe a bit too fast explanation... 😅
@999dunkins
@999dunkins Жыл бұрын
how do you even make 3d animation with it
@dugtrioramen
@dugtrioramen 2 жыл бұрын
Too bad animation player isn't good for relative values. So you still have to use tweens and yields for those
@Pirochiro
@Pirochiro 10 ай бұрын
Is there not still a slim chance of a call track method being skipped if the frame skips for whatever reason?
@Soroosh.S83
@Soroosh.S83 10 ай бұрын
Ah hell nah bro 💀 (In that case you can use delta time I guess which work for low and high PC)
@winsomegaming2549
@winsomegaming2549 2 жыл бұрын
Animation looks more work than coding really
@definite_d
@definite_d 2 жыл бұрын
Well, I wasn't surprised; the website does say EVERYTHING can be animated.
@the_RCB_films
@the_RCB_films 28 күн бұрын
yooo what!?!?!?!
@soundrogue4472
@soundrogue4472 10 ай бұрын
0:13 why code less?
@SpongeRoss
@SpongeRoss 2 жыл бұрын
How efficient is this in terms of performance compared to GDScript though?
@Gdquest
@Gdquest 2 жыл бұрын
Certainly much better as it's data running through optimized, compiled C++ code. It's interesting to see some people seem to think code would be faster. Animations still use code under the hood. Note that if the animation calls a function you wrote in GDScript, then it'll likely be the same as calling it in GDScript directly.
@SpongeRoss
@SpongeRoss 2 жыл бұрын
@@Gdquest I'm definitely going to implement this in my workflow, thanks!
@Gdquest
@Gdquest 2 жыл бұрын
As with anything when it comes to performance you should measure the difference. But making the engine do stuff should generally be much faster than using GDScript.
@SpongeRoss
@SpongeRoss 2 жыл бұрын
@@Gdquest Thanks again, and congrats on the kickstarter campaign :)
@AxZelAnimations30
@AxZelAnimations30 9 ай бұрын
Okay so..... Is this, like, the equivalent of Animation Events in Unity? If so then this is basically what I need.
@wiktorwektor123
@wiktorwektor123 9 ай бұрын
I don't know about Unity, but AnimationPlayer in Godot can animate any property of any node.
@AxZelAnimations30
@AxZelAnimations30 9 ай бұрын
@@wiktorwektor123 yeah I was able to work into it. It is basically like what AnimationPlayer does in Unity. Only problem is that you cannot DragDrop Sprites in it, which is honestly what I was hoping I can do. Some said there's a plugin for that but I haven't tested it yet.
@fuzzy-02
@fuzzy-02 2 жыл бұрын
*sirens noises* WOOOOOOOOOOOOOO....OOOOOOOOOOWWWWOOOOOOOO! *lazer beam!* pissshoouuwwwwwww *NUCLEAR AIR STRIKE!* KA-BOOOOOOM! ...sorry that beam got into my head lmao
@stanislavtkach333
@stanislavtkach333 2 жыл бұрын
It's harder to debug...
@rentaspoon219
@rentaspoon219 2 жыл бұрын
Is this better though?
@ishdx9374
@ishdx9374 2 жыл бұрын
is it not?
@Gdquest
@Gdquest 2 жыл бұрын
Moving code to data generally leads to fewer bugs as you can't make typos there. You can edit timings and whatnot. This has advantages at least.
@DarthVader-dm2lb
@DarthVader-dm2lb 2 жыл бұрын
Well hello there!
@aaush_
@aaush_ 2 жыл бұрын
Yo
@NexusBaum
@NexusBaum 9 ай бұрын
WTF! If I only understood, what's happening...
@thegameissimple
@thegameissimple 2 жыл бұрын
Except there MUST be drawbacks to this, for example performance wise or something.
@Gdquest
@Gdquest 2 жыл бұрын
No, it'll offer more performance compared to using GDScript or C# as it processes the data in native code. The whole animation system is written in C++.
@sslaxx
@sslaxx 2 жыл бұрын
No conditionals (so no if statements) or the like, so functions would be necessary for those.
@EROSNERdesign
@EROSNERdesign 4 ай бұрын
Buy this guy a coke!
@soundrogue4472
@soundrogue4472 4 ай бұрын
I do not consider this simpler; it's frustrating to work with.
@hungryOrb
@hungryOrb Жыл бұрын
It's Godot, like Robot. Nevertheless, great video!
How To Make a 2D Platformer with AnimationTree in Godot
15:19
NovemberDev
Рет қаралды 50 М.
Seven Minutes to Decide On Godot 4 in 2024
7:36
GDQuest
Рет қаралды 153 М.
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 25 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 28 МЛН
What if there was a faster way to animate your pixel art?
0:58
Smack Studio
Рет қаралды 2 МЛН
I Made a Desktop Pet in Godot
16:02
RachelfTech
Рет қаралды 82 М.
Immersive Sim in Godot 4: COGITO - Overview
8:22
Philip D
Рет қаралды 33 М.
Godot 4 - Tiled Dungeon Environment From Scratch
26:24
DevLogLogan
Рет қаралды 386 М.
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 279 М.
Technique for Creating Beautiful Level Design
11:48
Pixel Architect
Рет қаралды 825 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 3,9 МЛН
I made a game using Godot for the first time
7:35
shawcat
Рет қаралды 1,1 МЛН
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 25 МЛН