Godot GameDev QA: Answering YOUR Questions! #GoGodotJam

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] [Music] hey what's going on everybody uh please go ahead and let me know if the audio is working okay because i did a bunch of new stuff because i want to be able to record my desktop sounds but welcome welcome to the godot q a stream very happy to be here i have my assistant beanie and she will be taking questions as well uh this again is a stream that why i want to start making these just part of my repertoire but also it is because i'm promoting and i am a co-host of the gogudo game jam uh which is an awesome game gym specifically for godot that i think is really great for all skill levels and if you haven't joined i highly recommend that you do so the link should be in the description but i'll go ahead and check it right now that's my canadian accent i'll go ahead and drop this in the stream chat thanks nico thanks for you defined thanks everybody um yeah so yeah it was kind of a mess it's kind of difficult to record your desktop audio on a mac for some reason but i figured it all out so that's good hopefully um but yeah here's the here's the jam page uh cool stuff 773 people congrats everybody thank you so much for making that thing or making that happen that's epic four entries already even though they're probably just you know like placeholder entries to make sure you get something up there it's still like cool people are you know they're doing it they're doing it um so yeah let's go ahead and get started today uh if you have any questions i'll try and pay attention if i miss them because i don't see them in the chat please let me know and what i would like to do is pin uh the question i'm answering at the top except for the first question here uh i'm going to be making coins that you can collect with your player and that's because in actually not in my discord but in ranjan's discord uh in the help section uh i was kind of chatting with a guy about this and i'm like you know what i'm gonna live stream in two hours it's gonna be much easier to do it there um so yeah here we go um i am going to go ahead and go oh yeah the other thing i want to quickly mention is that everything is in the github right so that link should definitely be in the description but i will be updating all the code from these qa sessions uh right here in the github so you can go and check all the ones from the last few qa and sessions uh and then today we'll make one as well so what uh i'm going to do real quick is click create a new folder and okay say qa session underscore it's the fifth one uh what's it today may 27th may 27th uh 21. in case we're doing these for years okay perfecto all right so we can go ahead and get started check out so sassy's game he posted today what you think uh who's so sassy's i know he was in the chat last time but is he like another youtuber let's check him out is that how you do it nope all right if you link me i'll go check that out but uh what i would like to do is go ahead and get started with these coins so i'm going to import a player we'll make a new scene and we'll call this our uh coin test world okay and then i'm just gonna save this to our qa sessions five uh create folder coins the what's wrong with me the captain ghost okay uh so i'll do that save this world here and then i'm just going to import one of my other players this one should be good i just want something that can move around that's basically all uh we should probably make a new player i'll make a new player um okay so let's just copy this and yoink that and that should actually be good okay so i'm going to go ahead and make a quick player scene here um just for demonstration purposes so i'm kind of rushing through this let me do this and i'll say save branches scene um qa sessions playstation 5 here uh and this will be coin collector player okay hop in there uh and we'll go ahead and add a ku lesion shape and we're also well eventually we'll add an area 2d but for right now i'll just add a sprite and i'll add a script here and then we'll go ahead oopsies what just happened all right cool and then let's see if i run this can i oh pick a random color i don't want that to happen um we can do this too but i think yeah we'll leave that as that right there don't need randomize uh velocity times acceleration we don't have constants for acceleration so constant and then we need one more constant max underscore speed and we'll set the max speed equal to like a thousand an acceleration equal to a hundred let's see what else oh max val okay wait what just happened there we go okay cancel can i move oh no spark okay uh let me check out chat saw some movement here let me uh do a little bit of this a little bit of that make sure i can see my crappy little monitor here um oh saucy is on the jam page yeah we will definitely be doing that but that's gnarly that he already finished i i gotta tell you i don't even have a gameplay loop finish for my game i'll show you guys if anyone's interested i'm pretty happy with how it's coming along there's a few bugs i need to squash but it looks so cool i've done so many things that i've never done before i mean and that's really the spirit of the jam right is like kind of pushing yourself and that's why some people are like oh i don't like the james because of the pressure um but i think you kind of have to go over that because there really is no pressure if you fail because the worst case scenario is that you learn something and you've grown as a game developer which is really the point of a jam really is to kind of push you to do that i'm honestly not even following theme like that hardcore um because i'm really i really am just using the jam as a way to kind of force myself to make some stuff and learn some stuff on a deadline and that's kind of why i do it um okay hold on alexa silence sorry about that yeah well it's laundry or i mean time for the dryer okay so anyway for the sprite here i'm gonna go ahead and add the icon.p there we go and then i just happen to know that it looks a little too small so we're gonna change the scale to two by two okay and now i should have something that can move around the screen okay cool so this guy can move around the screen that's all we really need to do uh for the basics i'm actually yeah i do need to add a collision shape here so we'll just add well we should probably add a square shape and then zoom in here make that about the size of the icon not super duper important uh and then actually yeah we need to go ahead and add an area here area to d of course uh with a collision shape itself and then i'm going to go ahead and set that as a circle shape and then i'm going to make this like this big now i typically like to color code my collision shape so the actual collision shape that i use for collisions will be left blue but the collision shape on any area or something like that i i color codes that way i know so you can go here and just go to visibility on that collision shape and change it which is pretty nice you can also change the default color i usually change the default color to white in my project so that way it's easier to color these guys and you can just like drop one of these that one won't do anything like that okay and then here we know this is our coin collection area okay um and then yeah so here's our player that can move around he's got this area of course this is not going to be visible at run time and if a coin enters this area we're going to code it so that it must go ahead and we pick that up right and it displays that counter but before we go ahead and do that we need to make our coin so i'm going to make the coin next and to do this i'm going to start the base node of this coin will be in area 2d with a collision shape okay i'm then going to add a sprite so we can represent what the coin looks like and then we're also going to add an area to the area 2d this is totally kosher you guys you can totally add an area to an area 2d i do it pretty often because we're going to need essentially a detection area so essentially what we're making is a coin that when you get near it kind of flies towards the player and this is i mean you've seen this in tons of games right um ratchet and clank yeah i mean everyone knows hopefully what i'm talking about um yeah so it's it's it's very very cool um yeah you know what let me maybe i'll really quickly show no no let me finish this and then i'll show the game because this shouldn't take too long so we're going to call this coin okay we'll add a sprite here i'm just going to add this we'll keep it about that size and then i should be able to modulate it uh so this and this yeah there we go um let me take that down to zero there we go there's our coin it's gold ish actually i wonder can i make the godot face visible because that would be kind of cool oh no i want to go raw that's not what i want this set this to like one maybe i don't know you can kind of see the ghetto face there what if we set this to like just 10 and 10. oh whatever i don't know i thought it'd be cool to make like a gold godot face i could probably do with a shader but that's not the point of this so here we are so this is going to be our coin scene okay now we need to go ahead and define this so this is going to be the area that we actually get picked up and it doesn't actually matter but this is just how i'm going to do it um and then so i'm going to add a circle shape and we'll make the whoa we'll make the radius like i don't know well here let me just do it by hand so when it's when you're this when you enter this area that means the coin will be actually collected um and then uh dude i'm loving i'm loving the uh the the positivity here kind russian man it's fantastic um look at that everybody please hop in the chat i love hearing what people other people that get any kind of enjoyment out of my videos that's like why i do it so please let me know if you hate something if you love something if you want help please don't be afraid also you can join my discord uh there's tons of links to it i won't link to it now and ask me questions uh in private you can dm me there if you don't feel comfortable posting or anything like that and i won't even mention your name i'll just answer your question um so go ahead and do that if you feel comfortable so now we've got the coin area uh i've saved the scene i'm gonna go ahead and add a script here and we're going to do a few things and the next thing i'm also going to add a collision shape to this area and this is going to be called our detection area okay and for this one i'm also going to do a circle but i'm gonna set the radius like considerably larger like like however however this is when you insert enter this the coin will move towards the player so um that is what that is and uh i actually want to kind of that's a little too big we want it like probably like that yeah and you can actually go in here and change the radius yeah let's just do 300. i like round numbers um okay cool and then like i said so i will um leave this one as it is so we know what color that is and then i like to change the color of this one to be um gray like that and we'll just take this down a little bit like that all right and there's our detection areas now we know which is our detection area and which is our collectible area just like that nice and easy to see uh and then what we're gonna do is just detect uh or put a few things in here so we wanna do the coin entered um yeah actually before before we connect those signals no yeah we'll do this first i'm sorry so um sheet pics thank you yeah i mean if i if i get a thousand subs i'll send you a picture of my feet for sure um okay so this is going to be when we're collected so you can see that under the signals here i think they've actually added these um body shape entered and area shape entered signals and i don't really know what they do but you can totally get away with just using the area and body entered signals now area entered is triggered if another if you this area enters another area 2d right and then of course body entered is triggered if you enter a collision shape so one of these collision shapes of a kinematic body rigid body or a static body so um what we want to do here is make it so that when because this is the smaller collision shape right and this is going to be picked up when we enter our kinematic body's uh detect coin collection area so we want to do on area entered because that's an area so we'll say on area entered and we'll connect that here so on coin area entered you can see that and then we're going to go down to our detection area and we're going to say on body entered right because on this we want to actually detect when the player's body like the the this closing shape right here um yeah um so where was i oh yeah so um damn it my dog left me okay um so this collision shape that we're gonna detect when this collision shape uh is entering this which is our actual like body you can imagine this uh and so yeah there we go now in order to make those work correctly what we want to do is make sure we've got um correct layers so essentially layers are a way of saying uh you know what am i it's kind of like groups right you can say like we have a layer for player layer for enemy layer for coin collectible uh what have you so uh we go ahead and go down or it's general yeah and you go all the way down here to 2d physics oh now you won't back up huh you think you make a mistake she hates kisses but i love kisses so i give her kisses anyway because i'm bigger and stronger okay so you can see i already have some layers here layer one through five we have player enemy wall and player bullet i'm gonna add a new one and i'm just going to call this collectible okay and that's all we need to do you just need to make sure you have one layer that distinguishes what your player is and then another layer that distinguishes the collectible okay and then i think i think that should be good uh we'll see as we play it by ear here then what we want to do here is we can change the collisions of or essentially what these detect by going here to collision of the area and say what layer so the layer is going to be what layer you are on so i'll click this three buttons here and we are a collectible because we're a coin what do we want to collide with right is the player okay then we'll go down to the detection area 2d and we will go to um collisions and i'll say uh again well so for this one it actually doesn't matter what uh we are but i will just be consistent and put this as collectible and then i will again say we mask with the player but you can go up here and you can go to monitoring or monitorable right monitoring means we are looking for outgoing connections monitorable means that other people are looking at us for for so like if we enter their area but this is only for us this area is only going to check if people enter us right so i'm going to check monitor roll off because i don't want you know any kind of wasting processing power maybe some accidents maybe you mess up this just kind of simplifies that so we'll do that and then on this one we want both we uh oopsies right there we want to have both monitoring and monitorable and uh yeah there you go now we can actually do some code here so uh so coin area entered this is going to be where we actually get picked up we're going to say q free q free and then i'll go ahead and put an underscore next to area because we're not going to need this one okay and then on the textionary body entered what we're going to do and i'm actually going to go ahead and there's a lot of ways to make your coin move towards the player right um dude thank you man i really really appreciate that especially that you liked the gd script series i think i had a little rocky start i need to finish it up i've just been especially with the jam and everything okay if i put you down dude you're not coming back up um sorry i was talking to my dog um and yeah so i need to finish that up so yeah i'm sorry i haven't um but yeah i'm kind of i just got kind of swamped with the jam and a lot of stressful life things but yeah it i should be able to finish that series mostly pretty soon anyway okay so there's a lot of ways to make the coin move towards the player uh i actually want to quickly just kind of show you if we can go to rungen help and i can show you i think this is it this is so this is essentially what he did right he did direction um and he gets the direction to the player he does this i usually do player you should definitely be using global position here though you know i'll use the way you did um first and then we'll do it the way i would do it so what i'll do is i'll make a um well they should actually go above so if we go into function underscore physics process i'll pass right now and then i'll also uh give myself the ready function here uh and what i'll do is i'll say set underscore physics process false like that okay and then i'm also going to make a variable var target okay and we're going to go ahead and leave that undefined for right now this is the same as saying equals null but i'm just going to leave it there then what we're going to do down here is we're going to say on detection area body entered we're going to do two things one is that we're going to say target equals body okay and then we're going to say uh set underscore physics process true so if you don't know what this function set physics process does is uh it essentially turns the physics process on or off for this script so this script uh on the ready function we're turning it off we're saying false and thus nothing in this code is going to run until we set it true via something else so uh that way it doesn't if you have 100 coins on screen they're not all using the physics process um you know until you get near them and then they will start using the physics process um i i lied i i felt guilty to this face because she was looking at me and i was like i gotta do it i gotta let you up here sorry i just banged the mic a bunch of times but she's so cute i mean i hope everyone else thinks she's cute because i love her um okay yeah so then essentially we only start the physics process once this happens and we now we have a target right here which is our body right okay now we want our coin to move towards the uh our our target so what we'll do is we'll say var der equals target or sorry global position dot direction two uh target target dot global underscore position and you have to write that in yourself because they don't know what type of variable target's going to be so they don't know it's going to be a an object you could type into as an object if you want probably like i could probably say object and then this should work oh no we need to do node 2d and then we can just say target dot yeah there we go and then it comes in so you can do that if you want i'm going to go ahead and just delete that right now okay uh so this uh so this is the direction we would like to move in um now what we want to do is say that we want to actually move in that direction so we'll say global position plus equals direction times and then i'll make a constant and i'll say constant speed uh constant speed i will say max i'm score vel and we'll set this equal to i think a thousand's good and then i'll say uh constant acceleration equals 10. uh and i'm doing it very small because i want the coin to kind of like get like start slow and then speed up so that's what we're gonna do there so we're gonna do times um i'm sorry what we want to do here is say uh oh and then we need to make another var here so we'll say var uh velocity we don't have to do that here we can actually do that right here say var velocity uh equals so let's go ahead and let's assume plus equals velocity um okay so velocity plus equals dir times acceleration why is it not auto completing for me i hate type being okay dirt times acceleration uh and then i'll say um times delta okay uh and then i'll say velocity equals the what's happening right now dude oh because we can't do that because we're defining it okay fine so what i want to do is say i'll just make it up here and we'll say var velocity equals vector two okay dot zero okay cool there we go uh so then we've got the direction here the velocity we're going to increase by our direction times our acceleration so what this is doing is direction yeah this gives us a normalized vector pointing in that direction so it's exactly the same as doing what he did here which is to say get take our position subtract the i'm sorry yeah take the position of our target and subtract our position and then normalize it that's doing the exact same thing here so in fact maybe i'll actually just make that direction so it's very similar to his code and then we're going to go ahead and say velocity equals velocity dot clamped and then we're just going to say max velocity and what this will do is just make it so that we can never reach our uh or go past a thousand in terms of the speed here um and uh oh yeah sorry my dog is a beanie i love her she's the best little girl she's adopted and yeah she's just amazing okay but this is basically it for the code right is that we are going to yeah that's it so what what's going to happen here right we start the game we enter we set our physics process to fall so this only runs when someone enters our area which we do right here when someone enters that area we set our target as whatever body has entered that area in this case it's going to be the player and again we ensure that the body is the player by putting the detection area to only collide with the player it's not going to collide with enemies walls bullets anything it's only going to collide with that which is on that layer okay then we say on detection area body entered body target equals body and then we set our physics process to true now we have a target so we can get our direction which is a direction from us to the target and then we're going to increase our velocity by some amount times acceleration times this okay and that's essentially how we're going to make the movement go now i think this is not i think this is probably the the more um yeah you could use the move towards if you want this is just how i like to do it uh especially because it gives you a little more control if you know what you're doing but move towards is nice because it kind of helps you like not have to deal with all this stuff but i i'm just going to do it this way because this is how i understand and this is also not how i would do it this is just to kind of get close to how the captain ghost was doing it here however i am going to do it differently after i do this i just wanted to show this okay um now what we need to do is go into our coin collecting player and we need to go here uh and then we need to go to uh collisions make sure that he is on the player and what do we want him to collide with when i'm collide with collectibles well yeah it doesn't actually matter probably walls as well um yeah that's probably good so now if we go into our coin test world we've got our uh our player here and we want to go ahead and do is add some coins there we go coin okay uh and then i'll make some copies of it we'll grab these coins and move them over here uh okay and then we should see now i can't pick them up yet but they should all move towards me right now so if i go ahead and run the scene yeah you can see they're moving towards me um now this is this is kind of bad for a oh they oh because they're they're queuing free okay cool so they kill themselves when they get to me i'm gonna go ahead and just change the acceleration by a hundred so that way it's a little more noticeable let's actually make this like faster too let's do 2000 and let's check this out i think i need to make their their areas a little larger here because it doesn't it's not happening is like there we go let's do that there we go you see that so i get close and they come to me now i don't like this for a lot of reasons hisco is a little different because he had uh some some exponential acceleration which you can do that um but i think the best way to do it is actually tween their movement to the player um so what i'm going to do is oh but oh yeah this will work this will work um i guess we could lurp it i think you can do a tween in the physics process here um yeah we'll try it out we'll try it out so what i'm gonna go ahead and do is add a tween okay and then what we're gonna do is we're gonna grab that tween here by making an on ready variable on ready bar tween equals tween just like that okay now in this case what we're gonna do is i'm gonna go ahead and comment this out so now the physics process will never run right uh so so yeah because we've commented that out and what i'm going to do instead uh is oh actually so the problem with the tween is that well if we tweet it to a position we have to make sure that that position is updating so instead of what i think i'll do is do this yeah we'll do that and then i'll say [Music] global we'll say this we'll say so we will start this uh and then what i'll do is i'll say tween dot interpolate property uh and so we're gonna say self and then we're gonna say global underscore position so this is the property that we're going to interpolate the initial variant is going to be whatever our current global position is our final variant is going to be our target.global position uh and then how long do we want this to take that's up to you i'm going to start with 0.4 seconds see what that looks like then you've got all these options for how exactly you want it to move and i always use this website called easings.net so you can visualize what they do i'm going to use the circ right here i think this is good a nice smooth movement i typically will use just sign or quad or typically i stay up here i also use the bounce for flashing animations if you do in and out really quick it look really quickly like you do like a 0.2 second tween with isn't in out it gives like a cool explosion flash but anyway we're going to use this one because i think that's going to be nice so and i think we want yeah we're going to ease in cirque so we're going to do trans circ then it asks you he's in ease in out i don't even know what out in is but uh we're going to do ease in right that's what i said yep we're going to ease in and that's it uh so now what we can do i'm going to put this on a new line i'm going to put this on a new line and it'll say tween dot start now my one concern with this hmm it's just that this this this might not work we might have to use an alert function which is fine but uh i'm gonna go ahead and oopsies see what this does whoa oh yeah see so that's why the problem is that this is starting constantly so the way we need this to happen yeah we're actually going to have to lurp it instead of using a tween um because there's no way to update the target position as far as i know uh while this is happening but that's fine so what we'll do is we'll say um global position so we can actually get rid of the tween here go get coin uh and then i'll say gold position equals lerp um so from variance we'll say whatever our global position is to target dot global underscore position okay by weight and then this is what we need to set so this can change you can make this increase right now i'm just going to put this as 0.1 uh maybe not even that maybe like 0.05 um yeah and then i think this should work let's give it a shot if you can see that's like pretty linear i actually want to also change this collision shape to be smaller i want to actually look like we're hitting the coin here yeah so they're all coming to me but kind of the opposite of what i want honestly so what you can do is actually change this position so we'll say uh var t var t um and then i'll just say float actually we should probably just do this equal 0.05 okay how am i commenting oh i just do you just do command k uh and that should do that i think i think that's actually a default you can go into your project settings i'm sorry no it'll be in your editor settings i believe uh and you can go to shortcuts yeah so toggle comment uh mine's command k i think it's that by default but that's what i use if you're on any line so you can go like this and just if it's not command l that takes you to a line never use that in my life there you go yeah and so you can comment all that stuff out uh and yeah i think that's really really handy but any user so yeah i'll set t to this then what we'll do in the physics process is increase t so we'll say um t plus equals delta or something like that actually that might be a little too much because that's um let's see we could say t plus equals t and so that will be an exponential lerp like that um yeah that should work that should work i would like to kind of like do something anyway oh i think it's because my coin collection area is a little too big that's what it is is this yeah that's way bigger i would like it to actually hit me there we go i get get like right up on me there that's cool okay yeah so now they come to me and then i collect them like that so that's cool um so i think that's probably the easiest way to do it is just use the alert function um i think it's yeah i think that's pretty good um yeah and so you can see what happens here if we print t right and then we run this well hopefully i can only get one uh so you can see holy crap that got big um yeah it's weird plus equals t so i guess that's happened a little faster than i thought doesn't it but it says plus equals t t plus equals t i don't know i mean you can also this this is where you can make this essentially a tween uh is that you can go look up like a tween function right so we can go look up like um yeah we could we could make this like point zero zero five like that um i don't really understand why exactly it's doing that i think that's a pretty nice effect so yeah i mean there's tons of ways you could do this um and you could also do t times t right so this is going to be a much more exponential so that's cool yeah there's a lot of ways you can do this uh you can go actually look up between functions oh actually i think on this website you might be able to get the function there we go there's the math function so we can actually go and get the ease insert function here and then we can go you can see function ease in circ so i'll literally just yoink this function right here um i don't know if anyone else says that but whenever i take something like i i always say i'm yoinking it but so we'll say funk uh ease in cirque whoa this is weird it's highlighting that differently huh interesting okay okay and then we want to get rid of that and then that should be good oh number is not okay x uh and then this should be float okay so e function is in circ float uh return one minus square one time minus pal that all right uh then what we'll do is we'll say uh t equals ease whoa ease and circ uh and then we can say uh t right and now now we should have that working i mean it looks it looks very similar obviously but uh yeah anyway so that's what we're doing we're lurping based upon this uh function right here which is cool um and yeah so that's happening i mean and then you could do the exact same thing with uh tons of other like you could grab any of these that you wanted actually just for funsies let's go ahead and try the let's do an ease in bounce check this so this is return wait what it calls itself oh it needs the ease outbound interesting my dog making some weird noises oh this is an ugly function i guess that makes sense because you have to like stop yeah i don't want to convert this to a gd script but yeah i mean you could do that with any of these functions here this one looks pretty simple i don't think you can declare constants in a function in godot maybe i'm wrong but anyway so yeah you can just do that with any of these and then do something like that and then as you modify t we'll learn um from this position to this position by that amount and we're changing that amount um via this function so that's how that works this is how i would do it i think that's probably my preferred method um yeah lots of ways you could go about this though um i don't see where t is used okay um so damn you damn right mom ah okay whoa okay so this is weird let's say what if i do print t so that's exactly you're dead right i was i forgot t should be going there so it's still including zero which is weird one minus square root so we'll say t equals and i'll say turn t see does that change anything no that's weird one minus square root that times pow that what if this is just one nope that's really really fast okay point one huh okay so i guess this doesn't work so what i'll do instead is do what we had going on before here which is uh oh no this is because this needs to be plus equals t there we go uh now we can set this back equal to zero five right nope nope nope nope that's apparently not it which is weird that is very odd so but that's not a problem with this that's the problem with the function i don't understand why this doesn't work i guess i just don't understand how um those functions work but that should that should have worked but here we can just do plus equals t um and then now we can do this and now this should be exponential whoa that was fast so again i'm gonna do zero zero five maybe yeah i'll try if t is that small oh you know what we should also probably do is do this times delta there we go okay cool cool cool now we can make this more a more reasonable number there we go okay and so that that i think that's a much smoother thing and then again we can make this exponential by doing this yeah so lots of ways you can do that um oh it goes okay so just to make sure because it should it's pretty odd ah okay i see i see i say see it's not getting that much bigger here is it oh no no we'd want to do t divided by t right there we go t divided by t times delta y yeah there we go because then it then it gets bigger but that's already that's pretty massive um yeah anyway the that's that's how you would do something like that um i i i don't know i i knew more about like how i wanted to do stuff like this beforehand but like i don't know why it's not um i'm actually i'm interested i'm now i'm really perplexed like why was this ease insert function not working so if i do t um yeah so we should if we're providing x here then it should be 1 minus the square root of 1 minus power of x so x squared is because that number is getting smaller like if we do this what huh i guess because this becomes zero because this is getting smaller this is making that number smaller maybe this needs to be ease out zerk check that out let's see that shouldn't matter maybe it does i don't know oh now we got an error float and nil in operator plus there should not be nil did it just get so small they considered it nil like what oh no no because we need to say return that's weird okay so that one's working but that's insane that's moving very very fast let's do 0.01 maybe oh with that this also probably has to do with um times delta okay there we go that's exactly what i wanted okay finally that's how i don't know why the ease out didn't work oh i guess because ease out makes things smaller this only works with tweens that just use ease out or ease in whenever you want you you have to understand the maths a little bit i guess now i'm saying maths like i'm running or something but um you have to understand the math a little bit to understand that you can't do this because it's just making this t smaller and that's not what we want so i guess we could yeah you could actually do that i'm incorrect we would just have to do target.goldposition then to our position and then t okay i see i understand math i'm very good so i'm sorry if anyone's totally lost i'm going to go ahead and move on now yeah so it's so funny because i never think when i when i'm actually perplexed by a problem and i don't understand it i get really into it i don't even think to look at the chat and you guys solved the problem in 10 seconds so it's like i need to get better doing that the nervous beehive okay oh yeah control k sorry for if you're not on mac it's control frame if you're on mac it's command k uh whatever you guys use on your computers does an exponential lerp sound a bit weird given that i stands for linear so yeah um but so you're linearly interpreting the number based upon a value that is changing exponentially so the value t by which we're moving is changing typically linearly right so we don't change that amount we move by like 0.1 but in this case what we're doing is we're changing the value by which it is interpreting interpolating at a value which is not linear so that value itself is increasing a linear so yeah that's why yeah that uh i said that i don't know if that's actually correct but that's what i meant by that um matteo what's going on bro you're absolutely right you're the one who solved my problem about uh not returning a value danilo what's going on brother this is live yes this is live absolutely if you have a question shoot one i think i just i'm done with this oh if you put 0.5 in that function 0.99 comes out how would i make a follow behavior where the follower mimics the exact movement of the leader like trail segments in a snake game the typical follow behavior takes the shorter route which isn't what i want i see what you're saying okay um okay so anyway i i am just going to go ahead and quickly can i make note of the time does it tell me i think it's in on here on the obs studio i can see okay so it's 46 minutes 17 seconds i'm gonna start writing this down because when i do time stamps later it's gonna be nice so hopefully for other people and if you come back to this the whole video will be time stamps so you can jump around and see what you want um so i'm trying to write those down now rather than having to skip through a three hour long stream and figure out when i did certain things so it is uh 46 minutes did i finish this damn it okay four six minutes fin um coins okay cool make a note uh okay cool so let's check it out yeah some guy somebody did that for me once and i was like he probably did that out of like frustration that i hadn't done and i feel that because there's a lot of youtubers that i watch i'm like why is this not content like i want to hear you talk about two things and this video is three hours long but anyway um okay how would i make a follow behavior that's what i'm trying to figure out how to make a follow behavior where the follower mimics the exact movement of the leader like tail segments in a snake game okay so i think like anything in programming there's a lot of ways that you could probably go about this i'm trying to think so a kind of hacky way that i just thought of right and i guess we can we can actually start this so what i'll go ahead and do is again i'm going to go ahead and rip this code yeah we'll just grab this code exactly okay and then i'm gonna go ahead and make a new player and a new scene here so again i'll make another 2d scene and this is going to be follower test world save this we'll go up here still here your folder um follow the leader okay um follow the leader save okay uh and then again i'm gonna go ahead and make a kinematic body uh and then i'll go ahead and save this in the same place uh and we'll save this as a leader okay leader okay i'll add a script here um oh my gosh why does that happen that's one thing i don't understand like if i'm in the script it should know that i'm not uh in the scene tree trying to use the add node function i'm trying to use the command all function but that's why that happened i'm not even explaining that that's why that has that's happening to me um okay go ahead and add a collision shape and a sprite cool yeah and then again we'll make our sprite twice the size okay and then i'll add the collision shape as a square and we'll make it about that size cool cool by the way how's the music everybody everybody liking it is it too loud how's my voice over it uh it's das 88 i think i've got his name up there awesome guy tons of free music i'll be using it in my my upcoming game um create a cube the leader moves nostalgic leaf okay that's what i was gonna do you can't just be telling people there's a big reveal coming okay bro that's that is what i was gonna do essentially um kind of like we'll make a a list called points uh every so many frames what we'll do is we'll make a position well we'll essentially like make note of our global position and then we'll have some points then what we'll have is our follower will have access to that list and we'll say self.move towards position uh that is the at the end of the list and i'll show you what that is in a sec um yeah okay um anyway so i do think this is a really cool idea so i'm gonna go ahead and go for this so right now this guy should already be able to move around cool cool cool okay now what we're going to do here is uh we're going to make a variable called var points and this is going to be an empty array okay and you could type in this this is essentially going to be a pool vector array then i'm going to make a new function and we're say function [Music] create underscore points okay and we'll say pass right now now something i always forget i'm like what the hell is wrong is i make a function that's supposed to go in the physics process and i forget to put it in there so i'm going to go ahead and just put this in there preemptively before we even make the function okay and all we're going to do i also want to define something up here so say put that right here i'll say constant and then this will be like it's like max max points okay and i'm going to set this equal to 5 by default okay so what we're going to do oh i also want to make a variable called frames sorry um because i don't want to add a point every single frame so say var frame equals zero and uh we can do this do this i actually don't need these or that i should actually probably get rid of that from these ones as well because we don't need that at all okay again i'm gonna actually let me do that right now let me push what i just did to github there we go ah there we go okay solenoid solenoid is the name of the game uh that i'm making it's a play on solenoid which is an electrical device um and then solo so it's one guy he's electric there you go um qa sessions okay it's gonna be q5 underscore one okay and push forward all right cool now that all that that coin script is now on um at github and that link i dropped it and it should be in the description but i also dropped it if you scroll up in the chat okay so i'm gonna go back to this guy's script though so we've got points right um frame and then max points okay and that should be all we need so right here i'm gonna go frame um yeah so i'm gonna say frame plus equals one and then here i'm gonna say if frame modulo uh we'll do every five physics frames um equals equals zero pass so just really quick if you don't know what this does modulo essentially returns the remainder of a division so we'd say for instance what frame is it if it's one one divided by five is going to have a remainder the only thing that's not going to have a remainder is 5 divided by 5. so yeah we'll say if prime divided by 5 equals equals 0. in fact in this case we could actually i'm going to do this frame equals equals five and then i'll say frame equals zero um one two three four five i'm trying to make sure because that would mean that the first frame on the fifth frame yeah so every fifth frame okay good cool sometimes you need to put this below this in order to actually get that otherwise you're doing four frames if you don't understand what i'm talking about it's fine um yeah okay i'm gonna show you that game in a sec because it's not really 3d it's hardcore 2.5 d in fact that it's i'm actually still going to enter it as 2d because it's a 2d game that i just stuck on a 3d viewport and tilted so that way you have like this cool like weird perspective and i added a bunch of light maps to make things look really 3d but they're it's totally not it's really cool i designed a grid i'm glad you're doing it with the global position how did you already figure that out dude i haven't even written global position on here okay but yeah that's what i'm doing uh essentially and then so what we're gonna do is every fifth frame we're going to add a point so we're going to say here we're going to say points points dot append and then we're going to say global position okay and what this will do is add a vector 2 within the the list points and then what we're also going to do is then check so we're going to say if points dot i think it's length no it's size sorry if points.size and this gets the number of points in the array is greater than max underscore points then points dot erase i'm trying to remember because there's erasing remove uh one of them yeah i think we won't remove yeah we want we want to remove based on the position okay so we want to do uh oh actually i think we need to do pomp back pop back because for oh no no that was just i'm sorry that was just with the we can do this we can say remove um negative one not remove but remove okay and so let's go ahead and run this see if i the game breaks yep something's happening so i don't really understand because in python you should be able to do this right we want to remove from the the this should pop remove the the thing on the back but so here i'll just do pop back and then now we should not get the errors cool and i think this is because what why is this actually function move and slide okay let's just do this this is how you ignore things i hate this i think this should be different but like if i i don't need to use this value and i almost never do in my games uh and i hate having this ugly hashtag in my code but uh this is the only way to not get that that error which is annoying okay anyway so there we go and now if we go ahead and do this so every time it we can say print points you can see that now we've got a hmm how do we move remove well we can do this i can do this i can say remove um oh no no i'm stupid we want to do pop underscore front someone probably said that already let's see uh okay oh i do this on the grid blah blah blah for the gogudo gym is a 3d game with 2d gameplay considered 3d or 2d for the compo i actually don't even minus equals function or underscore equals function i actually don't know what that means i'm actually much better gd script than python okay let's see now this should work there we go okay so you can see it's making an array with and that stores our last five points um in fact we probably yeah i think that's how we'd want to do it and then what we'd want uh there's a lot of ways you could do this you could actually make this a much larger array or you could even make this smaller okay yeah here's how we do it so the max points is basically going to correspond to um well that with the the frame here is going to correspond to the length of the player so if we go here and we create a follower right so i'll go ahead and add and i'll say uh follower there's a lot of ways that you can why am i doing that um kinematic body 2d so a lot of ways that you can do this a lot what i've been doing recently is like i'll make um a child right and then what i'll do is i'll say you know get the get get this node and then remove myself as a child from here store the the id of that and then do it that way um so for instance in this well here i'll make this i'll say save branches scene should not be in here but in here uh and then we're going to call this guy the follower i mean i spot that wrong follower uh and then what i'll do is we'll go into here and uh add this and then what we'll say is like um funk underscore ready uh and we'll say or remove i don't say uh get underscore parent dot remove child uh self okay right so we remove ourself and then we add ourself as a child of this node uh which you can do in several ways you can just do like a get parent loop but i think you can do get underscore tree um dot root and then we can say dot add child self okay uh and that should work except we might want to do call deferred child but this is fine so essentially that and then what we want to do also is we'll say var later and we'll set that equal to null and then right here what we'll do is we'll say leader equals get underscore parent and then here what i'll do is i'll just say leader oh i've been having some weird ear pains because i recently just like cleaned out my ear and it's like yeah a little sore i don't know why um maybe i'm getting an infection that would suck okay so function ready leader equals get parent leader dot remove child self get treat so then yeah anyway um skeleto what's going on yeah okay so this is qa but after i finish this which should be soon i'm going to show off my my current progress on my game because i'm pretty excited um yeah okay so debug gd script return value discarded oh debug why don't i have that is it in project settings or the editor settings general debugger you'll have to give me yeah i'll look that up after but that's a really handy tip um nope okay anyway um okay cool cool cool so leader equals get parent leader.remove child cell phone headshots up okay so anyway what this will do is just make it so that we follow uh that we are now a a global child right we're a child of this scene so go ahead and add our leader scene here and then we don't even need to add our follower scene there's other ways you can do this like i said i actually probably should do it another way in case you want to add your follower um like for instance in my player script here uh you can see that i've got a global script called players or i'm sorry i got a autoload script called globals and i've got a variable called players which i set equal to myself then what you could do is spawn this anywhere and then you could say for instance leader equals globals dot player right but there's some problems with that uh that this is uh bulletproof essentially which is nice unless you're doing my very odd case of making a 2d game in a 3d thing in which case that breaks okay we'll add a collision shape and now we'll add a sprite and then to differentiate um we'll leave him a little smaller like 1.5 by 1.5 uh-oh okay and then i'll do the visibility here and we'll make him like a he's a little a little green i don't godogue if we do like just 1.2 and maybe one maybe just two that's fine yeah there we go okay and then maybe i can reduce this a little bit make a little more cool and this is like one point two that's fine anyway why do i do this it doesn't even matter okay cool there we go so there's our follower he's green and then what we'll do is go ahead and say function underscore physics process pass and then i'll say function follow pass and here i'll call follow okay and what we'll do is we'll say um self dot global position equals uh leader dot um leader dot uh points dot pop underscore front oh i wonder if that would work now there's gonna be some inherent problems with this but uh let's go ahead and give it a shot huh oh ah so what we'll do is we'll say if leader dot points and we'll do this see but now it's like exactly on me so maybe we do pop back no same deal oh no that's why okay call underscore deferred underscore child self oopsies and then we'll do the same thing here i'll say get tree dot root dot call deferred oh we can actually do this there we go okay okay so now he's falling exactly but obviously he's like a little deep front same deal he's a little he's a little too um oh what we can do is make him sit at the end okay so what we'll do is we'll say if leader dot points equals equals um dot points yeah and then we'll say and leader dot um points equals oh no dot size equals equals leader max underscore points there we go so now he will stay at the the end of the trail yeah look at that all right that works beautifully i mean so now we want smoother motion so what we'll do here is go into the leader um and we'll do two things so for one thing what you can do is just get rid of this whole frame thing in general so what i'll do is delete this we don't need that anymore and then i'll do this oopsies okay uh and then i'm just gonna comment this out even though it's not that important and then what i'll do is i'll change the max points to like um i don't know like 30. now let's do 60. okay there we go and now you've got a really smooth movement so here we can do 50. i know let's let's do like uh let's do 20. at that so now he goes exactly where i go uh now you can make him stop for the player there's there's probably a lot of ways to do that um one way would just to be that we can do this yeah actually we'll do this really quickly okay and then we'll say if leader dot points dot size yeah whatever if leader. points out size um equals equals i don't know let's say like liter.max points uh divided by 10 we'll say like times 0.1 and we'll do this i'll say int to make sure that we get that right because that we want to make sure that this this could be a float we want to make sure that's an int um yeah let's do this actually it's greater than that oh actually and then in which case we can just do that instead of this right so we can do this and then come over here do this so it and leader.size is greater than int that that's actually better uh okay not smaller we don't want to add cancel ah okay that's the problem okay okay i don't know i'm trying to just play around here this should be is greater than let's let's just like hard code this is greater than 10. it shouldn't keep moving though that's that's why that's weird i know you'd have to play around with that to get that to get him to stop but you can see that he's he's falling exactly where i went and you can see like if i for instance go like this here let's actually make this longer so that way i can really demonstrate that let's make this like a 40. so if i go like this and then i go like in circles you can see that he's doing all that he's doing exactly what i did um which is cool anyway so that's that's one way that you could do that um and then yeah i don't really know why uh because it should only do this we actually don't need to put self here it should only do this let's see chat probably told me um look at all that akinus vienna i've heard that it would be considered 3d 3d from redefined yeah so i think he's he's thinking about 2.5 d games in the fact that you're using like 2d sprites just on like 3d essentially it's it really is 3d but you've just used like essentially 3d 3d um things with 2d sprites attached so they're like billboards so they move like to and from like this but they're still flat but they're 3d mine is literally just to a 2d game that's tilted right so you could do this with a shader i've just done it in 3d so i think mine does count as 2d but we'll see i don't really care to be honest i think it i i think um honestly it is 2d um how are you what are you doing okay um yay i'm trying trying a 3d game too and have questions regarding to it i've got a question but it's a noob one the animation player node works i mean how to change position of a sprite in a specific frame and save it for example like move it up a bit it can be useful to make uh shadow power-ups like yeah yeah so anyway i'm going to push this to github then we're going to go ahead and i'm going to pin skeleto's question so that way everyone can see that's what i am answering uh but before i do that i do want to show off my gogodo game jam game because a few people have asked about it and i'm pretty proud of it um let's also do this so i'm going to go ahead and this is going to be um qa 5 underscore 0 2 okay and push origin so now this code is up on there if you want it uh oh this should i should get rid of this that's not necessary because look it's crazy i don't understand actually why and i would really like to figure that out did he just do it oh i get it now i actually do get it i'm not going to finish it off i i should okay the reason this is happening is because this is still happening this isn't stopping so so that code right here this was working but yeah okay okay so rather than do that what i want to do is check i'll say if um so i'll say if um globalposition.distance2 um leader dot global underscore position and then here so we're essentially saying if the distance to his position is greater than um i don't let's say like 200 right that's gonna be like your following distance then we do that okay cool yeah i mean there's there's some kinks to work out for sure but um there you go now he like stops there i mean there's ways to essentially like make sure that he stops slower and uh make sure that he doesn't like automatically start spawning at you and stuff like that you can connect signals between them and so you can say that like when stopped right then you stop making those things so there's all kinds of things you can do about that so for instance in a liter we could make it so that when input vector equals equal zero or for instance if um if input vector equals zero or if velocity equals vector 2.0 then we stop this right we could say stop creating points so yeah but lots of ways you could do that i'm going to go ahead and clear these frames here because we don't want that that's not going to be very smooth that's how i did it in my line 2d trail that i used in the game that i'm about to show you right now i'm pretty excited okay good oh code goku dough jam here it comes so no wait what oh okay okay so this is i was having some problems because i'm using github and icloud and so my icloud was screwing up my github so i made this a note a dot no sync file if you know how this works this makes it so icloud ignores this file and now i'm just using github on both my laptop which i finally got fixed uh in my desktop so anyway here's the file i thought it was gone i thought icloud deleted it all that would have sucked okay so you can see here's what i'm doing so here is i think i just moved it which i don't want to do yeah it did huh yeah i did move it anyway um so uh there's no gameplay loop but i've gotten the first basic enemies the destroyable wall that is gonna be a big point of gameplay right you have to destroy this um and then also the main player is basically entirely done i've gotten even some sounds in there so yeah so we'll go ahead and check this out but you can see the entire game is actually just 2d it's just 2d but i put it on this viewport and tilted it and what that does is we can go ahead i'll first actually run the 2d game this will go here to the 2d world and if i run this you can see that it's very flat like right it's flat it's ugly it sucks but what we're going to do is go here to the 3d viewer and if i go ahead and run this you can see we've got this cool and so there these are the first enemies um i'm calling them screamers i don't know if you can hear the volume they can't kill you yet but they they work essentially okay so you can shoot them like that uh so there's how you do that and i really like the movement here the trails did these cool line trails like this um right now there's a little bit of a bug that the um if i change the screen size it no longer looks at the mouse anymore i don't really know what that's all about hmm looks like there's a few little like buggy glitches but yeah let's come over here and then we can like take out so this is a barrier so you can't get through this until you destroy it and so like that and then you can go through so that's essentially there's going to be some gameplay loops so for instance you can see that there'll be like a wall there and then you'll have like enemies spawning and you have to take out the wall while dodging the enemies and killing enemies and doing stuff to get to the wall that'll be like one for instance i think way you could do this uh so i've challenged myself to use some shaders i think i'm only using one shader right now there might be another one but the one shader as you can see is the chromatic ameration aberration when i shoot uh it aberrates like that i've also got a nice screen shake i've got a little bit of knock back stuff like that see what are people saying dude thank you um oh see you see you nervous beehive thanks for coming hanging out um yeah dude i really like it i don't know if you can hear the noises i've done a lot with the the sound can you guys hear the sound in the game um but i've done a lot with the sound so it adjusts so their sound um it's it's i've basically made a faux doppler effect if you know what that means the closer they get to you the pitch changes um i'm sorry not the pitch but the the volume changes and then also based upon their angle their turning uh and their speed the the pitch of their sound changes so you can hear i think it sounds cool i haven't added a sound effect i think he got stuck on the wall they don't have they don't really have the fantastic ai quite yet but yeah and then yeah all right i mean that's it that's it so far that but that's quite a bit and then i'm making it's a tile set so making the levels i should be able to make at least the first three levels once i finish the tile set uh and then what i would like to do is um probably make the because the background is kind of ugly right now like it is the point is that i want to to be it to feel like very uh you know you're on this path that's floating above like something crazy like this right now you could just fly off but uh so this is a parallax effect background and i'm gonna have like multiple layers of things going on here and then obviously right now is just the default gray but it's gonna be like a cool yeah i'll probably add a shader do some cool stuff there this is not a shader this is just a png image um that i have there but anyway okay let's get back to the q a because that's not what this is for i haven't been streaming it because i've really been like like it's hard i know that i've got a lot of scope creep potentially happening on that game so i'm really trying to be smart about it um yeah and try to like really grind i'm not as effect efficient while i'm streaming um if you can't tell like a lot of this stuff would take me 10 seconds to make but it takes me a lot longer because i'm streaming um and yeah anyway okay so let's see what chan has to say uh i'm glad you guys like it that's a really great um to hear oh no the sound is quiet i can hear it but it's pushed into the background beginning here that's the look i wanted but haven't tried any 3d yet so that is like that is literally 2d you guys um i literally just took a viewport let's see i probably still have it i can open it and just really quickly show you so what i've done here is we've got a viewport and here's the node so this is it this is the game there's nothing special about it and then all i do is i attach it to this viewport i put what this is a mesh instance and then i take that mesh instance and i just go down here to oh i don't think i think those should all be nope that's not right oh yeah because i don't yeah i don't i don't mess with the transform i go to the i went to the rotation degrees and rotate rotated it on the x-axis by 20 degrees this way and then i just put a camera looking at that and that's all that's all i did here and everything works perfectly doing this except few bugs i found one is if you put a world environment on a 2d world um it screws it up so or globally so or i'm sorry as long as this is uh if you put this as a canvas layer it screws it up so you need to do i leave it as clear color and it affects everything um from the 3d environment that's bug number one bug number two that i still haven't solved yet is that if i resize the window the the mouse position no longer works okay so if i go ahead and resize the window here um you can see that it no longer responds to my mouse position which is a big problem because not everybody is going to be able to play this game in a massive like 1920 by 1080p resolution some people are gonna have to play on smaller computers and so yeah that's a big problem i've thought about several things one thing i wanted to do was potentially make it so that you control your movement with these keys and then you control you can shoot with either the mouse or the space button right now um and then it's just full auto and then or and then you aim with the right keys right so i was going to have you move around like this and you point the direction you want to shoot potentially even not what's it called potentially not even like requiring you to press a shoot button but just like when you use your keys to aim you shoot in that direction um yeah that's just one way you could do it uh this game whoa we got a lot of errors here in the debugger oh yeah okay that's just um yeah that's fine this is this is one attempt at fixing it that didn't work i was trying to use the 3d mouse position and see if that would work to work here but it does not oh well anyway okay i'm going to quit that we're gonna get back to answering skeletors or skeleto's question i'm getting some i'm gonna go check my discords i'm getting some pings there and i want to see so it's in people are bringing here general saw that okay questions announcements okay cool no one in there okay cool yeah okay so caption go captain ghost has joined late but i think i solved it so go ahead and check that out um we could just quickly even go over that but i do want to get to skeleto's question because he's actually been wandering this for quite a while how to connect that to your judy world scene you literally so you just put the whatever 2d scene you'd like to be viewed as a child of the viewport node i'll actually go ahead and just toss this link in here to the reddit posts where i was told about this um let's go here profile did that not work what doesn't all work get me like three all right um cool so i was actually trying to make a shader that did this this is so this whole game is inspired by this if you know what this is uh you're an og this is the sly cooper um two you know this is like cooper three or bentley hacks computers he plays the game loved it very simple 2d game um but so i'm just making it like hardcore lots of graphics adding a bunch of new features and did figure out how gamepl make a shader that works for this but it just doesn't look nearly as good as get using the godot system so let me go ahead and paste that link in here uh i think the mouse coordinates and your 2d elements are in different spaces you'll probably need to map mouse coordinates to local space first yeah you're absolutely right um but the problem is all they want is the mouse coordinates or relative to the screen size rather than to the um uh 2d viewport or anything like that because it's tilted i would imagine that they might do something like that but if as long as the i i would i assumed until this point that get global coordinates got the the screen size right or at least got the the utmost root and then got it there but for some reason because it's not doing that so yeah i do have to figure out doing essentially what you're saying but i just don't know exactly how i would do that okay so now let's go back up to skeleto's question uh because now i'm going to try and answer that you get global mouse position doesn't work um simon i don't i don't know why i think it's like uh like what danilo's saying it's like or i don't know if it's that's how you say it um yeah okay nice i've got a question but it's a really new one can you explain a bit how animation player node works i mean how to change the position of a sprite in a specific frame and save it for example yeah so wrenches got a pretty decent video on this but i'll go ahead and we'll make a new 2d scene okay and then here i'll just add a sprite and then to that i'll add an animation player okay and then to the sprite node we'll go to my icon oh my god i use command a a lot usually which is why that's such a pain for me and i'm going to make this bigger 202 okay uh and then we'll go to the animation player and um this is it it's down here at the bottom now if you ever get lost right you wanna for instance i click the sprite node and like let's say a lot of times this will like go away you won't be hearing i don't know why it's not happening it happens all the time on accident but of course i can't reproduce it uh so something like this you're like oh well i want to animate keyframes go down here and then click on animation you don't have to click on the animation player and then now what you should be able to do is well of course it's not oh because we haven't started an animation but now you're actually in the animation studio and then you can click on any node you want and go to the animation you can actually animate any node in the scene tree but note that animation player uses the exact path so it uses like essentially get node so if you change the name of something or move it it can break it which is a problem uh it's pretty good about fixing it but i don't know i've run into a lot of difficulties with that so uh we've got our sprite i'm gonna make a new animation and just to show you the very basics um well you want to we'll make a stretch first so uh new animation i should have named it and then i'll go you can click here on animation you can load animations from other animations players that you've saved you can save one duplicate which is really handy i use that a lot rename edit transitions open inspector edit transitions is pretty complex but we'll just go to rename here and i'll call this stretch okay now how long do we want this animation to be is what we'll set right here i think i want this to be let's do like 0.6 seconds i'm sorry not point 16.6 seconds then we can go ahead and change our zoom value zoom in like that and now you can see this is a snap so it's going to snap every 0.1 seconds uh and i think that's actually going to be good for this a lot of times what i'll do is actually i'll change this to 0.05 um so then it's every rather than every 10th of a second it's every 20th of a second um okay you can also go up to playback options and change the speed at which something plays back but i would recommend what you try and do is actually just make things line up the way you want them to hear and so that we don't have to mess with this and just there's a lot of reasons for doing that but just trust okay just trust okay so now we've got this this looks nice and what i'm going to do is essentially we can go here and we can click this keyframe and what this will do is this will insert tracks and keys uh we're gonna use with zero curves and click create and you can see what it's done is it keyed our position and rotation degree at this frame right now i actually don't even care about the position rotation degree so i'm gonna go ahead and delete those and what i'm gonna do is go over here to my sprite i'm going to go to scale and i'm going to i'm going to go ahead and click that and click create and now i've got a scale then what i want to do is halfway through i'm going to go ahead and reset the scale to b um we'll say we'll put the uh we'll put the x at like five right okay and then i'll key that as well uh and then what we can do um you can see that we come here and it stretches like that now if we go we can go to this button here and this is the loop function now you can see it goes like this and then comes back now if we play this right here you can see that now we've got something that stretches like that now skeleto's question i mean how to change the position of a sprite in a specific frame and save it for example so the animation player will not work for movement unless you're trying to make very reproducible movement like you can only make it do the exact same thing every time there are ways to make it a little more dynamic but it's pretty complicated and hacky um that i have figured out or at least thought of i haven't actually even done it but i thought of in my sleep that's kind of weird i i have like realizations in my dreams about code sometimes um okay oh link to my discord server absolutely uh let's go ahead and do this invite people copy and paste cool there we go um another people oh yeah i'm not good at saying this i don't know i always forget but please subscribe to the channel if you're not i realize the other day is i have a lot of people that come hang out with me all the time i know them by name and they're not subscribed to me so i'm assuming they just uh didn't haven't realized that they're not subscribed to me um maybe they just don't like me enough but uh yeah it helps out the channel a lot uh especially as i try to make um more and more videos it's nice to know that they are actually doing well rather than spending 20 hours making a video and then it gets 200 views kind of hurts so uh if you if you could subscribe please consider doing so i also don't want to make you feel like you have to do that so anyway so this is going to be we're going to go up here yeah if you don't like me or if you just don't like subscribing to people feel free not to but i would appreciate them so we'll say animation player examples save okay now uh we can go ahead and make a new animation and we'll say move okay and then of course we might want to for instance make now i'm trying i'm kind of confused skeleto if you're still here um can you expand on it in a specific frame and save it for example so i'm just gonna do what i interpret that to mean so what we'll do here is we'll go up to the sprite and i'll again just click this by default again it's just going to get the position and rotation degrees i actually don't need the rotation degrees i just want the position um and then what we'll do so we'll keep it at that and then i'll go ahead and i'll move it like over here let's say okay and so let's just put that at a thousand and i'll key that frame and then i'll go ahead and put this on that and now if we play here you can see that it's moving back and forth it's moving pretty quickly and we can change that a number of ways i'm going to go ahead and make this two seconds and then we'll go ahead and move this move it over to one minute you can also at any point if you've selected a frame like this we can right click anywhere and click and click insert key i'm sorry i'm sorry duplicate key and we'll do is we'll make a copy of that key you'll also see this white line up here and essentially what that means is that nothing has changed in between this frame and that frame and that's sometimes actually useful to do delete that key there you can also click on the key and up here you can see that you've got several things you can change you can change i don't actually know what the time uh the time property does oh this is this is the point in time on the yeah point in time well that's weird that's the point in time on your timeline here that this actually is at there we go um easing uh i think this has to do with things that you can change how quickly they actually like come into there stuff like that um let's see if that does that do anything here oh yeah that's sweet i've actually never even played with that let's do that here let's do three ah okay three and then what i'll do yeah interesting yeah i don't know why it's not stopping slowly but anyway so that's how you do that and then you can actually change the values of these there um you can also just move everything on screen and then in calculus now you want to go ahead and save a value at a specific frame now the way you do this is a little more complicated but not much so what i'm going to do is go ahead and add a script here okay and then i'm going to make is a function i'm going to say function that's going to be store underscore position or store pause and then we'll say position okay uh and then what i'll do here is i'll say um var stored underscore position position um and then i'll just say vector 2 because i'm not going to define it and then what we'll say is we'll say stored store position oopsies stored position uh equals position actually that could be a problem because uh this is shadowing awesome there we go because uh position shadows the actual the the position property right here which is a problem okay now you can do this two ways you can actually provide the global position or the actual position um oh no i don't know we would say we actually don't need a variable here so we want to store what position we're at so we just say position okay uh and then what i'll actually do here is i'll say print stored position okay now we can do from the animation player is we can click add track and go to call method track you can see we've got several different tracks here 3d transform but zero curves which i haven't really gotten into too much audio playback i actually honestly have not gotten into much more than the call method track um and property track i use the bazir curve track once i think ranjin goes goes over that in his which allows you to kind of control the smoothness of things um uh moving there and then we also have the um yeah i'm sorry so we're going to use the call method track then which node do we want to call method from the sprite node you actually don't even have to have a script you could call a built-in function so i'm gonna have to get water in a second because my throat's dying but you can call a built-in function from like node for instance if you wanted uh and then we're i'm gonna go ahead and pause this i'll click right here right click set insert key because we're on the functions track now it's going to have a shirt uh search this and i'll say is i'll say store pause okay and so now what happens is that um position is now stored uh so now what we can do is uh now this won't do it i don't think um in the editor unless we've got a tool script let's go ahead and see like if i do this it's not going to be printing anything but if we start the oh yeah what we need to do here let's go here now so yeah it this animation will not actually play in the actual game unless you do one of two things one is to click this this means auto play right uh that and so essentially this means when the game starts you're gonna play this transition two is to go in this script and we can say animation tear animation player dot play and then the name of the animation we want it to play uh and then three is to use an animation tree i think it's animation tree yeah animation tree this is deprecated don't use this the animation tree here um which is much more complicated and i use it a lot of my games i'll go ahead and jump into that just by showing you another project in a second um but now if we go ahead and start the game and we look over here to the output um you can see that what's happening is every time it hits that position it's getting the position and it's printing it so it knows that it's there okay um now there's a lot of other things you can do uh for instance if if you wanted to query that we could say animation uh or actually there might be signals so we go to animation player and go here so uh animation changed animation finished animation started and cache is clear i don't know what caches clear does but you can infer that this plays when the animation starts this plays when the animation finished i think i'm looping animations let's go ahead and zoom out a little bit looming animations it should play every time it's restarts and every time it hits the end of this i'm not sure though animation changed uh of course is if you change animations mid game it will they will alert you of all those things um yeah so there's there's quite a few things you can do there you can also make physics process and then you should be able to go like animation player if we go to properties here um you should be able to get like the time uh maybe i'll look in the docks for that but like if you want to check every single um full second you could say get animation player time modulo 0.1 and then every 10th of a second if if mon if animationplayer.time modulo 0.1 equals equals zero then do this and that would essentially give you access to every single tenth of a second we could check what our position is here uh if you want to play two animations at once from the same animation player you definitely use an animation tree but it is a little complicated but anyway um yeah because by default they all okay hey i'm here i mean for example in idle animation some of my sprites should be a bit higher i want to move them a bit higher than others or in a run animation some sprites a bit uh up higher than the other um yeah yeah yeah so like for instance we've got this and uh let's say that i want him to be higher in this position what i could do is i could go here uh well first off let's do uh whatever we are here i'll key this and whatever we are here why is that not working oh because we keyed animation player uh i'll key this oh whatever we'll do that uh and then i'll go here and i'll key this then we'll do here is then change the y to be um say like negative 10. uh you can't even see that oh no you can't never mind oh this is it it's the wrong one no that that's the right one okay cool and then that'll be right here so now if we do this let's actually make that a little more dramatic shall we let's make this like negative 100 oh that's weird hmm that should not be let's let's delete these real quick that was a goof oh no this was the problem oh no it's not no okay yeah that's fine actually let's make this zero and then let's remove these nope that's not what i wanted to do delete keys and make sure this is happening how it was before yeah and then so if we go like halfway in between this which would be 0.5 uh insert new oopsies and we'll key this frame here uh key this frame here key this frame here uh and then if we go here we can change this to be negative 100. there we go and then that's gonna make him hop on the way back yeah anyway okay um and how to save it okay so then you would do exactly what i did here so uh here i have uh i've done a call i don't know if you saw me i'll just start this over so what you do is you make a a function so i made a function so function store position and what i do is i say i have a variable here called store position which i've typed hinted as a vector2 you don't even need that though you could literally do that and you'd be fine uh then we do function start position store position equals position so this gets our position property um right here whatever we're at and then stores it in this variable but the other thing about this is you really don't need to do yeah i think that's probably the best way to do it so you can make sure you're at that frame and then we can say print stored position and uh this is only for demonstration purposes uh then what we'll do is we'll go into our animation player here we'll click add track go down to this green call method track we'll make sure that we select the sprite node because that's where i've added the method then at this point where i want them to be higher i'll right click and then click insert key then i'll search the name of the function so this was store position and then we can go ahead and run this and you can see down here in the output it prints the position it's at right and it's gonna be the same every single time though um but yeah so yeah that's how i would do that if hopefully that's what you meant by saving it um i'll go ahead and show you a little more advanced project that i have made with the animation player here so go to godot code godot man i think i've actually shown this already project.good oh okay so here's good oh man okay and you can see that he up and down movement i haven't specified yet but he can run okay he can move his arm should oh yeah i made his arm um that way but yeah he can shoot do all the stuff and this is all except for the movement function in the the head rotation function this is all done with the animation player uh and stuff like that so uh what i'll go ahead and show you here so here's my animation player here's my animation tree i have a second animation tree for the the canon and then a one for for the regular stuff now we can see if i go to something like uh uh let's go let's go do click this let's go to run and then i'll zoom in here so this is a massive animation right uh and so what we'll do oh this isn't gonna work if i've got this active though turn that off if i play this you can see that he starts running which is pretty cool and essentially what we've done is i just saved one of these animations like here's an up pose there's a down pose now you can actually see that his whole body is actually going down so here we go up down and then here we're down and then here we're going this is actually further down here's the up here's all the way down all the way up all the way down so he's actually going up every single actually yeah if i click through it's probably better up down up down right and then what's happening is that it's moving those between those points um the best it can and you can set up zero curves if you want again i haven't here and that's fine and then what i've done and let's go ahead and activate this and you'll see if i start running i don't just start the animation i kind of smoothly run into it so here if i click it a bunch you can see that it's doing some weird stuff and that's because i'm transitioning smoothly based upon my velocity from the idle animation to my running animation and i'm doing that in the animation tree here and i got movement right i click edit um and you can see um essentially let's go so i've got this thing called blend position if we go here i think this is a this is a blend space 2d yeah so we go blend space 2d and then click into this um or is it something else no blend space 1d is what this is yeah because it's a it's a linear thing here let's see click it delete it i really hate this ui though i'll be honest but anyway um and then so what we've got is we've got this position here and this is essentially the blend space so i should i can move this and you can see that the more this moves towards this dot the more i run the more it's towards this dot the more idle right so that's the transition uh and so essentially this is a value of zero to one and uh what we can do is from code we can go and grab that value so movement blend position and we can set this value which is which is equal to wherever this is from our code which oopsies which i'm doing right here uh in velocity animation tree dot set parameters movement blend position to our blend position and then i'm calculating the blend position based on my where is blend position uh oh right i'm still stupid right there so var blood position equals um the current velocity uh in the x direction divided by my max velocity right and so that means at the if if i'm at my max velocity that will equal one and if i'm at uh if i'm not moving it will equal zero uh and that's how that works pretty simple um yeah that's how you do that really okay great if you've got any other uh questions please let me know yeah i i was actually uh i made the art for this and then started working on this like i was gonna make it like kind of like a samus type game but i don't you know you should make the games you want to play and i'm like i don't really want to play like i don't really like platformers that much so i i shouldn't make this game but i do really like this and the idea was to involve nodes and so i actually made actually someone on on reddit just recreated a version of it and i'm pretty psyched about that because um i think it's really cool but i made this background because you can get access to all the godot icons if you go to the godot engine github they've got a file with all of the uh svgs for these and then i just open them in my editor and convert them to pngs and then stuck them and just pattern them like this it's a cool like node pattern uh and then so some guy made something cool like that on sorry not itch reddit if we go here oh wow oh no right here i think i got okay there we go five updos yeah this guy made a cool wallpaper too i actually like it with a darker color better for his jerseys but um that wasn't going to fit with the itch i o page you can see he's done the same thing so yeah i think it's really cool and yeah that's basically that um anyway so yeah this was going to be a game where all the enemies were different nodes in godot and like you had followers and people like that and it was all everything was going to be your gadoman you're playing with the i don't know if you notice here but he's shooting nodes it's like pay attention to the bullets like they're they're actually there's nodes actually just look like look like right here when i when i fire the gun and there's a node in the the middle uh yeah if i if i rapid fire you can kind of see it so he's actually shooting notes like node 2ds at people that are just super powerful node tds but yeah anyway so yeah i thought that'd be cool yeah obviously there's some big problems with this that i didn't care to solve oh i actually did figure them out oh so and i figured them out in my other game based on some guy's function that he made but anyway because it was when you lerp around a circle because godot's unit circle is weird it won't go 360. like if i'm looking here and i point here instead of just going like this it goes all the way around the circle and back and that's why the head was doing some weird stuff there um and the arm but i figured that out in my in my newest game so cool um in the jam stream the other day you it sounded like you guys wanted a browser playable version of games do we need to do that if so how do you test an html export i thought the doc said you can't test it locally um lots of ways uh you can test it semi-locally but it's i i wouldn't even bother doing it and i honestly forgot how to do it at this point you don't have to put an html game but if you're using godot it's stupid easy to do an html export you don't a lot of people like oh you should use gles2 and stuff like that screw that i mean it maybe it makes your game more accessible i guess to people with crappier computers but i never do i always export at glas 3 to html and all my games work just fine a few errors occasionally happen but usually nothing big performance is usually the only thing that gets hit a tiny bit and also for some reason the glow or bloom effect if you have it in your game is way more intensified but that's it so all you have to do is literally just if it works on a normal export it will work on that export and it will work on your mac and other exports now mac is kind of weird because they have like weird security features that prevent you from opening apps that are not uh are made by non-apple verified developers but like anyone who's had a mac for a while knows how to get around that um so yeah i mean you literally just go i don't know why i open up project settings it's it's as easy as going um i did it again project uh export uh and then we can literally just uh export as an html here so click add html5 and that's it um yeah and then we would like obviously provide a path to export to which i don't want to do at this point and and that's it you don't have to change anything that's literally it oh except uh yeah so i would then put it so um i don't know if you watch that stream go back to it but bitbrain said he made something that makes it so it automatically all you have to do is when you export to html it automatically um puts it on itch as a private so when you go on itch if you go to your dashboard you can see i've got an unlisted game here perry right and i can go here and i can i can run the game the reason it's unlisted is because uh i made some changes to it and go to 3.3 and it essentially makes the game not work i also hate this game but um so like wow that's actually definitely dope anyway um so yeah you can make it private so you put save as a draft and then you can test it on itch um yeah so what daniel was talking about um is exactly what i'm talking about and it's bitbrain made a video on how to do it um bitbrain auto export html5 no not ganki although that's how i learned how to do it the first time uh huh i figured it would be much easier to find it but yeah he talked about his stream and i think he linked it in that stream so go check that out uh and you should find it there oh this is the shader language interesting okay anyway um sorry random random bumps in my head um yeah yeah yeah so what yeah i i need to figure out what you're doing daniello and because i have not uh done that yet and it would be really nice to have that automatically done for me um yeah i think my girlfriend left which is cool cause that means i don't have to stop streaming but um yeah i mean and then what you've kind of got to do is a little weird stuff here after you export for html what you should do then is let's see i did it again project exports you should export it as a pck.zip file then unzip that file am i doing this right i don't know it's kind of complicated um because you have to put an index.html or name it index.html um inside a zip file and that will be the file that is run anyway um itch account for the jam so i haven't used it yet except to browse other people's games um yeah dude that's freaking epic that's exactly why we made this um i'm so excited that you've done that that's that makes you really happy to hear because that's i didn't even finish my first jam so if you don't don't feel bad but anyway yeah so you can totally go on uh on issued io uh and then when you go to here no i guess you go up to your creator dashboard here uh you can click create new project uh and then you would just essentially you go visibility and access is the last thing here saved as a draft you can also do restricted which is the same thing no one can see it except for those that you send the link to which might be nice if you want other people to test it for you uh lots of cool stuff yeah that's that's epic societies oh you already let's check it out real quick i mean i shouldn't do this technically redefine's gonna get mad at me but uh let's check it out i don't play by the rules okay i park in the red so sees tree invaders is this done already dude how did you do that whoa dude was that my score up at the top oh that's who do you get dude this is sweet for a first game you've clearly gone through a lot of stuff oh my god whoa um one thing i don't know if this is happening or not um but would it be cool that you got more points if you were able to chain together kills like you get multiple people on one laser um i think that would add a lot of incentive to the game and also like that's very very cool like that that should give me extra points i also don't really love how it's it's floats instead of uh integers like i think you should keep the um oh that's cool that's dude i am absolutely blown away by this being your first game ever and your first jam account because this is sick this is like legitimately fun to play people with much more experience can make games that like maybe a little higher quality but aren't like this is actually fun you know what i mean you've got a solid idea and you can refine it more and more you clearly like did all the art yourself which is epic i mean freaking sweet dude and of course like you can keep um at 2 30. oh two okay crap okay all right you guys um unfortunately i have to go because my girlfriend has an important meeting that she has to do a resume in the apartment so uh yeah sorry i gotta go uh if you have any more questions please join my discord community i'll go ahead and link that again uh all orgo and renjins i'm trying to get mine popping but for some reason i just find myself answering people's questions um uh in in in in rungen's community like i'm always in russian's community uh just answering people's questions and stuff but please feel free i have a questions tab just drop your questions in here we also got a little general tab or chit chat um which is cool uh this supposed to be a reply what can i do with things anyway um so yeah please please go ahead and do that um because you can't pm me on youtube you can leave comments if you want i'll respond to the best i can but uh i actually like go on discord constantly i'm just on my phone on board and i'll come in here and i'll actually answer people's questions like thoroughly right and if i think it's great like i thought um his question was really fantastic a really teachable moment i went ahead and added that and did it live on stream um of course if you don't want me to mention your name i won't mention your name uh it's just that easy um so yeah please please go ahead and do that please like subscribe comment all that good stuff um again i like don't usually tell people to subscribe to my videos um because i think it's like obviously i would like you to subscribe but i don't really feel pressured but i realized like the other day i actually just didn't realize i was not subscribed to a channel i like a lot because he's never said it um and so yeah i figured i'd start saying it because yeah please subscribe if you like me uh-huh so yeah thank you guys so much i apologize for this being a little shorter than usual um but yeah i'll i'm gonna set up another one of these for next week um yeah next week i am gonna have to stream because we're gonna do i'm gonna stream playing these submissions here uh oh i love this asset pack it's fun um and um yeah that's about root that's a boot all right so yeah thank you guys for watching i'm gonna go ahead and leave the stream up for probably 10 more minutes so you can chat amongst yourselves if you would like um ah okay that's cool um because every laser shot costs one point oh that's cool that's very very cool that's a really cool mechanic i think you should just make it um integers and you should also make something that lets the player know that that's happening so a little bit of player feedback like having like a multiplier up at the top like actually i've got i've got two minutes okay really quick i i have this game the sound is awful um because something happened on istario where they i think they like restored the file and now all the sounds are awful but uh luckily i made a settings oh actually you can probably hear that so let's make sure i know they're off okay cool all the sound is really bad but you can see here on this game i've got um uh up here in the top right this is your multiplier oopsies for some reason i forgot to say the explosion uh as a sound effect and so you can see that like when you get uh when you get the multiplier there together uh it actually does like change up here so it gives the player a little more feedback i honestly don't even think that's enough but i think you should add something like that to your game it would be sweet yay nostalgically i'm excited for you to be there um so yeah anyone else you want to chat with me you want to chat with other people in the community just ask a question a lot of times other people will answer it i think it's great mine or rundown community both open to everybody um and everything all right so thank you guys so much for watching and uh have a good one again join the gokudo jam if you haven't okay all right thanks guys you
Info
Channel: ACB_Gamez
Views: 231
Rating: undefined out of 5
Keywords:
Id: YYSu5iT3oUY
Channel Id: undefined
Length: 145min 19sec (8719 seconds)
Published: Thu May 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.