 Hello there, well thanks to Nathan from DDQuest and the amazing party sequence he's making for Blender, I'm able to make videos again and in this one I will show you how you can make a simple implementation of a fall through mechanic. This mechanic consists of a jump that passes through a floating platform and it's a cool feature you can have in your game. To achieve this behaviour I'll be using a simple platform actor and a playground level just to set up a use case for this mechanic. So I'll be using a kinematic body 2D, an area 2D, two static bodies, two collision shapes 2D and three collision polygon 2D. Also I'll be using two collision mask bits and two gd scripts but you can use more depending on the implementation you apply. Ok so let's start the preparation. Let's start with a kinematic body which will be our platform actor and let's also add a collision shape 2D here. I will create a rectangle shape 2D which I will increase just a little bit. I also turned on the snapping settings so you can see here that I have snap on. You can press S for toggle snapping and you can press G to show or hide the snapping grid. For my platform actor I will also use a custom script that I have here. This is part of my platform template asset. But this will be available in a report story that I will put the link in the description. You can have access to all of this. I will also add a state machine here which will be responsible to make transitions between the idle, the walk, the jump and the fall state. This will also be available in the link in the description. And the next step for this particular mechanic is to add an area 2D which will be calling this pass true and I will call this the actor. The area 2D also needs a collision shape 2D but here in this shape I will copy the shape of the collision shape from the kinematic body. So right click, copy and you can go here and paste and I will move this up here. It don't need but it's good to have this on the same boundary of the collision shape from the kinematic body 2D. So I will save this now in the actor player so it will be the actor scene. Now let's block the level. I will create a simple node 2D here which I will call level 00. The next step of our site is to add two static bodies. This one will be the floor and this one will be the floating platform. For the floor we will add a collision polygon 2D, ok this is the floor and we will add two shapes here in the floating platforms, a collision shape which I will create here and another one for the platform that will be above this one. So here we have it. For the level we have one static body, one collision polygon 2D, another static body and two collision polygons. This step is optional because not everyone will like to use it but if you want the character to pass while jumping the platform you can turn on the one way collision here. You can see that it has this arrow here which means that this is the only way the character will be able to pass through this platform. So it can jump from this point up to this point from bottom to top and I will also turn this on this other shape here. Ok, so the fifth step is to set up the collision layers we will be using. So let's go to project settings and we will go down here to the physics so we have layer names to the physics. I will use the first one for general purposes and the second one for true purposes. And the next thing we have to do in this setup here is to add each physics object to its respective layer. So the collision of the floating platforms, the collision layer it won't have any mess because it won't try to detect any collision but it will be on the pass-through layer. And this one on the floor, same it won't try to check for any collision but it will be on the general purposes layer. The actor will be on both, actually the actor will try to check for both the general and the pass-through layers but the pass-through area to deal with we have will only try to check it won't be on any layer because I don't want anything to detect it but it will try to check only on the pass-through layer. So just a small parenthesis here. The layer property means that this object is in this layer so other objects will try to search for this object in the layers here. And the mask is the layers that this object is searching for collisions. Now let's start the preparation of the gd scripts. As you can see I already have the physics of my actor prepared but as I said it will be available for you to use in the link in the description so don't mind on that. But the important part goes here in the input process. And as you can see I'm not using the common input process, the callback, I'm using a custom one as you can see it received the actor. This means that the actor here is deferring its call of the input process to the state we are in right now which is the idle state. So every time you see actor here it means that I'm accessing the actor here, the kinematic body. The important part goes here. The first step is to create a condition to verify if the player is pressing the jump button. Let's check if event is action pressing actor dot jump. Actor dot jump is a property I have set in my kinematic body which I basically can make any action on the project so let's go here in the input map. So I can create any settings here and then I just need to set it here and this will make sure that this actor here can be used for let's say multiplayer games and that kind of stuff. So jump is jump one which is a space here so jump one space. So if player is pressing jump we will check if this actor has a node called pass true. This means that to make this mechanic work we just need to attach or remove this node here so we can pretty much save this as a branch of the scene so let's say we have our player here we can save the pass true and to make this work if we delete this our character or actor won't have a pass true mechanic but if we want to add a pass true on it we can pretty much just instance it on the scene. This is a very modular way to work and I like this very much. So if we have a node called pass true and if action pressed actor down which means that at this moment we have the key down press it. The difference here is that an event already happened the difference from the input class is that we can check if this is currently being pressed so this is the present we are checking for now not what already happened. This is a good way to combine inputs so when we press the jump button and we are pressing the down button this will happen. In our case what will happen is that we will go to the actor and set its collision mask bit one which is this bit right here the pass true bit ok so the general one is bit zero the pass true is bit one. We will set the bit one to false this means that the actor will stop trying to search for collisions in this bit in this layer here which will mean that we will stop colliding with anything that is on this layer in other words the floating platforms. Otherwise if we don't meet these conditions here we will just perform a simple jump. If the jump key is pressed and we don't have the down key pressed or we don't have the pass true node there we just perform a simple jump ok so this is everything we need in the kinematic body in the actor for this mechanic to work so let's move on to the pass true area 2d I will open the scene here and I will add a simple building script in the scene and the first step on the pass true here is to connect this body hesitate signal to itself so on pass true body hesitate I will delete this just to clean up the script a bit and here in the script we will start by checking if the body we just stop colliding is inside the collision layer bit one this means that we stop colliding with a body that is in the pass true layer because we set up the layer one to be the pass true layer if we stop colliding with something that is in the pass true layer and the parent of this node is not checking for collisions in the bit one so if we are not checking for collisions remember we check for collisions in the layer mask in the collision mask not in the collision layer this one means that this body is inside the layer of the bit one and this one means that we are checking for collisions in the layer one so if we are not checking for collisions in the pass true layers which means that it passes through this test here because we set this to be false so we are not checking for this bit anymore if this is math we will go to the parent and set its collision mask bit one to be true it will start checking for collisions in this layer again this is pretty much everything you need for this to work so let's go back to our level our test level I will add the actor here as a child of the level I will save this in the levels folder so let's create a levels folder with this name level zero zero here and if everything goes well as expected we'll be able to pass through a platform and pass down so from bottom to top and from top to bottom and that's it guys did you like this video format I mean in a recipe style let me know that leave a thumbs up or down if you didn't like it this way I know if I'm in the right path or if I should change anything also do you like platform games I will try to make one right now how about to check my platform template I'm developing the link for the github repository will be in the description so just check it out if you're interested that's it guys that's all for now thank you so much for watching keep developing and to the next time