 This video was brought to you by my patrons. Thank you so much for your support Hello there. So yeah, now I can record on full HD, but that's not of the concern of this video But I think that I've been using and maybe you've been using the process and all the good old building callbacks in the wrong way, or maybe we didn't realize some Problems with the current way that we approach the callbacks. So with callbacks I mean the already callback the process callback the files callback. Anyway, all the virtual methods that go provide to us So let's go into an example that I have and let's see What's the problem and how we can work around it? So let's get started So I am with the combat prototype from kitchen tails. If you are not following kitchen tails Recommended to do because I'm posting a lot of stuff that you can follow on each IO and you can also follow the development on github I've put the link in the description but here we can see I will open the jump class and We can see that here. We have the physics process and inside of physics process I have a logic that will try to replenish the jump amount that the player has So it has a available amount that it decreases here in the apply method So it will try to decrease the amount of available jumps and on the physics process It would check if it can replenish this amount setting it to be the maximum allowed jump Let me show you what's the problem with that. I will put a very simple print here So we can see something in the output and I will print contact replenish This is the the logic that I'm trying to to make here when the player is in contact with the floor It will replenish the jump amount and now I will extend this class So I would save it and I will extend this class Extend script and I will call this one time it replenished jump let's say we want to make a Twist in the logic. Maybe we want the jump to replenish from time to time, right? So we jump and then two seconds after the first jump the jump is replenished Maybe this can be good for let's say flat bird logic or something like that So I will attach this this time it replenish jump to the jump node here So we can see that this is the script that it is using and I will Inside the physics Process at another print so we'll see what is the the logic that is currently bling being processed by the physics process So I will print time it replenish and If we test the scene now, we can see down here in the output that both Prints are being called so the contact replenish and the time it replenish and this is because Godot will call the virtual callback from the base class And the virtual callback from the inherited class, so it's calling both callbacks And maybe this is not what we want This can cause a lot of bugs imagine that you have three classes stack it So you have a hierarchy of three classes and you have logic inside this method What you can do and this is how I am working around that is that I will open the jump class again and Instead I will encapsulate this logic inside method So we can override this method because as you can see we are not overriding the virtual method from Godot itself So the virtual callback we're not overriding. We are stacking logic on on it So instead we can encapsulate this logic. Let's say I replenish Method and I will create this replenish method here replenish and I will throw this logic inside This method and in the inherited class. So in the time it replenish jump, I don't even have to Use this process. I will just override the parent class replenish method and here. I will just print Time it replenish time it replenish If we see now, I will test this again You can see that now it is calling only the time it replenish method So it's printing only time it replenish. This is because now that we created a method that we can reliably Override we can have our logic self-contained and we can override or maybe we can call the parent class Logic as well. So if you want to do that, we just have to make a super call by adding the dot before the call of the method And with that we will also call the parent class Logic as well. So if we play you can see that we have contact and time it being printed out in our output So this is my tip because I think that this Gives us a lot more control over the logic that we are using in the callbacks I also have here the platform action bus. I Used to have this filter event logic inside the unhandled input But now I just use it this filter event action because I inherited this class to make another class So for the combat action bus, but that's it with that We give more control to us over what will be called and what will be processed in The actual physics process because now we can safely override our methods or logics So that's it I hope this helps you build more reliable code And if you think that this doesn't make any sense or if you think that maybe something is wrong Or maybe there is another manner to approach this problem leave a comment below Let us know how you work around this problem And if you like it, please let me know by leaving a thumbs up This will help me a lot knowing that I'm producing something valuable to you And also if you want more of this content, please subscribe and turn on the bell I don't know if this works or not, but I know that less than 10% of my Subscribers actually receive or actually watch the content the new content that I'm producing So maybe this helps you get more content So I don't know if you to be what will actually deliver a notification for you, but this helps So that's it. Thank you so much for watching keep developing and to the next time