Тёмный

How passable (one-way) platforms work in game development! 

Challacade
Подписаться 65 тыс.
Просмотров 768 тыс.
50% 1

#shorts #gamedev
One-way platforms are very common in platformer games, so in this video I go through how I implemented them in my game.
This game is made with LOVE, feel free to check out my full tutorial:
• [2021 Update!] Make Ga...

Игры

Опубликовано:

 

14 июл 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 722   
@ghb323
@ghb323 Год назад
another way: check if y speed is upwards or downwards
@StickThisUpYourAnus
@StickThisUpYourAnus Год назад
Wouldn't that cause clipping when the player jumps from underneath but falls back down mid transition?
@JamesMurphyInvest
@JamesMurphyInvest Год назад
Couldnt the player still be under the platform whilst y speed is up? Therefore still colliding with the bottom of the collider?
@ghb323
@ghb323 Год назад
@@StickThisUpYourAnus have the hitbox of your character’s feet to the platform be ~1px tall and the platform’s hitbox also 1px tall.
@guilhermehenrique-zj5tt
@guilhermehenrique-zj5tt 11 месяцев назад
i did like that.
@WellDressedMuffin
@WellDressedMuffin 11 месяцев назад
I think this solution is better. Instead of constant, repeated checks on every platform you only do a check when you need to. Event driven logic is much more performant.
@AxidoDE
@AxidoDE 6 месяцев назад
This video is brought to you by "Solving a computational problem by throwing more processing power at it".
@tomasgoes
@tomasgoes 5 месяцев назад
Optimisation? What's that?
@Betterthenyou375
@Betterthenyou375 5 месяцев назад
I’d say he’s working at the same level as some AAA dev’s. Saying fuck all to optimization.
@Pluto-ek3mh
@Pluto-ek3mh 5 месяцев назад
What would be the optimal way of going about this?
@baronbacku9984
@baronbacku9984 5 месяцев назад
​@@Pluto-ek3mh wouldn't running the check whenever a collision would occur suffice?
@Pluto-ek3mh
@Pluto-ek3mh 5 месяцев назад
@@baronbacku9984 That’s what I’m thinking, but this comment and its replies beg to differ.
@Stevejustt
@Stevejustt 7 месяцев назад
You can avoid all the constant checks by checking the collision normal when colliding. The normal will tell you which direction your hitting the platform from. Can just ignore if hitting from bottom 🤟
@dailyfunnytv358
@dailyfunnytv358 6 месяцев назад
it's harder to do when you just use some guy's template on top of an engine you don't even understand 😂
@notnullnotvoid
@notnullnotvoid 6 месяцев назад
No, that would be slower. Not that it matters, either way will be plenty fast enough, but installing a collision handler that runs for every collision event and check whether it's a player x platform collision is almost certainly more work (and importantly, less consistent/predictable amount of work per frame) than just iterating all the platforms every tick. That said, you probably want the collision handler anyway be able to conditionally ignore specific collisions instead of disabling the collider entirely.
@nintySW
@nintySW 6 месяцев назад
@@notnullnotvoidIs this a joke? No way a collision handler (that Already has to run mind you, you're just hooking onto it.) is slower than running a check for every platform every tick, even with optimisation for only doing the closest few.
@notnullnotvoid
@notnullnotvoid 6 месяцев назад
@@nintySW Yes way, it sure is slower. An extra (more complex) check on *every* ongoing collision every frame, vs. a simpler check per platform per frame and then the disabled hitboxes presumably don't even even enter broadphase at all let alone enter narrow phase and have their contact patch calculated? None of this matters, mind you, but yes, the contact listener approach will be slower. You learn these kinds of things in the process of shipping a physics-based game with a perf-sensitive sim step.
@theoverseer393
@theoverseer393 6 месяцев назад
Have it detect the player by proximity
@the-rudolph
@the-rudolph 2 года назад
Nice video! Unsolicited fun fact to boost the _algorithm_: In the original Super Mario Bros, the game checks if Mario is landing on an enemy (good) or being landed on (bad) just by checking Mario's vertical velocity component. Thus, you can squash a goomba from below if it lands on Mario while he is falling slower than it.
@Challacade
@Challacade 2 года назад
I never knew that, they certainly got creative with their collision logic!
@michaeldiaz4285
@michaeldiaz4285 Год назад
Thanks for the explanation !
@goldfishgallant1432
@goldfishgallant1432 Год назад
Does that make sense? If a Goomba is walking then Mario's velocity is certainly greater when he lands on it. Wouldn't the Goomba need to be falling slower than Mario in order to squish it from below? Which should also be an impossible situation because if the Goomba is above and falling slower than Mario, Mario should never be able to collide with the Goomba.
@the-rudolph
@the-rudolph Год назад
​@@goldfishgallant1432 Just Mario's vertical velocity was checked, not the difference between the two characters!
@goldfishgallant1432
@goldfishgallant1432 Год назад
@@the-rudolph So Mario just needs to have a vertical and falling velocity to kill the goomba?
@snesmocha
@snesmocha 6 месяцев назад
Insane amount of checks per minute… just get the normal of the object or set the normal to a directional vector
@makotomiyamoto5249
@makotomiyamoto5249 6 месяцев назад
Could you explain?
@DARK_AMBIGUOUS
@DARK_AMBIGUOUS 6 месяцев назад
If your saying to add a single square that only has a collision one one side, that works but it's a bad idea because the second the middle of your character goes threw it, it will teleport you forward till your fully out of it, or fully on the other side, I used to use this to make 1 way passages and stuff in my games but I stopped using this method
@user-mf4uo9ox2y
@user-mf4uo9ox2y 6 месяцев назад
Games and even programs in general use an insane amount of checks per minute, I don't have much coding experience but I don't see why it's an issue to have more checks. From what I understand having checks is good but let me know if that's not the case
@KatherynneF
@KatherynneF 6 месяцев назад
@@DARK_AMBIGUOUSjust make the one sided collision only apply to a specific collision box and have an additional thin collision box at your feet for ground detection
@cheggf
@cheggf 6 месяцев назад
​@@user-mf4uo9ox2y More checks gives performance losses. A few platforms on their own wouldn't do much to the optimization, but it would add up with other things being coded in similar ways.
@omegaSomeone
@omegaSomeone 6 месяцев назад
What I did on my one-way platforms was make two hitboxes: one for the bottom and one for the top (in the case of your grated platform, it would be the 2 highest pixels). The bottom hitbox lets anything pass through it, and is just there as a sensor: the higher hitbox would have no collision with anything touching the lower one, but would with anything not touching it.
@FerousFolly
@FerousFolly 6 месяцев назад
pretty clean implementation, actually, very few checks needed. and dropthrough could be implemented by just shifting the player's collision box down by 3 pixels when pressing down on a platform, easily hidden with a brief and simple dropping animation
@theonewholearns2711
@theonewholearns2711 4 месяца назад
In other words, jumping at one-way platforms from the side risks hitting the side? Not a dev btw.
@FerousFolly
@FerousFolly 4 месяца назад
@@theonewholearns2711 nah you'd extend the lower hitbox out a bit at the sides to avoid that unless you want to have ledge hanging on them, in which case you'd have another hitbox at the edges and a ledge grabbing hitbox the top half of your character to acrivate the ledge hang state.
@thneitor
@thneitor 6 месяцев назад
A trigger collider below the actual collider: I'm about to end this man's whole career
@DEVdreamweaver
@DEVdreamweaver 4 месяца назад
what about if you're coming from the side?
@thneitor
@thneitor 3 месяца назад
@@DEVdreamweaver You don't.
@CallMeCasper_
@CallMeCasper_ 11 месяцев назад
In Unity you can add a platform effector 2d and it makes it a one way platform automatically, just make sure to check "used by effector" on the collider you are wanting to change.
@autoimmunedefficiencysyndrome
@autoimmunedefficiencysyndrome 5 месяцев назад
Unity 😂
@gamezboi_
@gamezboi_ 5 месяцев назад
@@autoimmunedefficiencysyndrome wts wrong w/ unity
@Fishlady143
@Fishlady143 5 месяцев назад
@@gamezboi_nothing, other engine devs just act like unity is trash
@kaboomsihal1164
@kaboomsihal1164 Год назад
In godot I just check "one way collision" lol
@bubi1909
@bubi1909 9 месяцев назад
Works in unity too with effector
@scrunky8683
@scrunky8683 9 месяцев назад
any tutorials for that
@kaboomsihal1164
@kaboomsihal1164 9 месяцев назад
@@scrunky8683 dude it's one checkbox. I don't make tutorials but there's about a dozen on youtube I can think of. It's also in the documentation. Or you just look at some of the sample projects with platforms. You really just need to spend 5 minutes looking for it.
@tPlayerioT
@tPlayerioT 8 месяцев назад
of course, Godot has anything you may think of
@mouinhizem1428
@mouinhizem1428 7 месяцев назад
go dot for kids Lmao
@zebede38
@zebede38 6 месяцев назад
You could also have a check on collision to see if the player is below the position of the platform, and ignore it if it is
@Artholos
@Artholos 5 месяцев назад
Nope. That would be simpler, easier, and scalable. Gotta do it the Threadripper way.
@austindrexler2092
@austindrexler2092 Месяц назад
This works fine if it’s just a single player and simple npcs. However this falls apart if you have add multiplayer or any traversal ai behavior. Also the colliders will spend every frame checking the player’s y position. I’d probably tie the collider flag (i.e. the character’s collision layer) to the entity that is jumping based on it’s movement vector. If a player or entity is moving in the positive y direction, it should not collide with platform. On the way down if it moves in the negative y or is at 0 delta it should check if its collider overlaps the platform. If not then switch the collision flag back. The neat thing with this is you can also make the player “hop down” from the platform by toggling the collider flag based on user input.
@mudsp1ash
@mudsp1ash 6 месяцев назад
Unity has a component called Platform Effector2d that you can attach to your colliders. It ignores collisions from specific directions if you enable the one-way option.
@iiropeltonen
@iiropeltonen Год назад
This sounds perhaps computationally heavy? But a nice solution. I always just checked The direction of vertical velocity.
@GrandHighGamer
@GrandHighGamer 7 месяцев назад
It's a completely negligible cost. Anything on screen is already doing a ton of processing just to render, checking a single variable and adjusting its collision state will barely make a difference.
@goldencookie5456
@goldencookie5456 6 месяцев назад
Maybe you could only begin the check when the player is colliding (as a trigger) with the collider.
@robertonome2448
@robertonome2448 5 месяцев назад
@@GrandHighGamer those stack up tho. its def not a good practice. Plus, using observer-pattern checks - then verifying the collision's normal - for the matter is also much cleaner 99% of the time.
@atiedebee1020
@atiedebee1020 5 месяцев назад
​@@robertonome2448explain how comparing normal vectors decreases the amount of checks and/or is cleaner than comparing the y positions
@robertonome2448
@robertonome2448 5 месяцев назад
@@atiedebee1020 collision events... you obviously wont check it at every frame, just during collisions. you cant even check collision normals outside collisions
@ImmortalTimothyM
@ImmortalTimothyM 11 месяцев назад
Really cool. The movement and animations of that bird is nice as well.
@Kanibulus
@Kanibulus 6 месяцев назад
Has 3 legs tho 😢
@derpzking1833
@derpzking1833 4 месяца назад
ur joking about 3 legs right
@Kanibulus
@Kanibulus 4 месяца назад
@@derpzking1833 no.. look closely
@cluborronn
@cluborronn 6 месяцев назад
The velocity check or using the normal is probably the most efficient solution here, but another thing you could do is have another bigger collision box around the platform that checks if the bird is above or below it. So it only checks if the bird is near it, instead of all of the time
@NichHustler
@NichHustler 6 месяцев назад
Wouldn't it be better to make the player two collision boxes split in the middle. So if players top half hits the platform first he passes through, and if bottom half it's solid. This would also allow for emergent gameplay and exploits by more advanced players.
@robertonome2448
@robertonome2448 5 месяцев назад
@@NichHustler nah. first solution is much cleaner. plus youd still have to do the same check
@HashCollision
@HashCollision 5 месяцев назад
Throwing more hitboxes at it is probably more computationally heavy. (I am assuming engine implementation details here, but it is reasonable in this case) which do you think would cost more? More collision checks, or a Y position check?
@robertonome2448
@robertonome2448 5 месяцев назад
@@HashCollision just a standard collision_normal.y check for the default bounding box of the platform (no actual need to have more than 1); if collision_normal.y < 0, collide, else dont. infinitely less costly than checking (amt of platforms) * FPS * (amt of actors) all the time.
@sirquackz47
@sirquackz47 4 месяца назад
This actually helps, thank you
@dexlovesgames_dlg
@dexlovesgames_dlg Год назад
You should make a follow up demonstrating how to jump down through it. Pretty easy but interesting
@nodrance
@nodrance 6 месяцев назад
If you hold down for a second, or down+jump, or whatever, then disable the collision until you're outside of it
@RobinRhombus2
@RobinRhombus2 5 месяцев назад
The way I had learnt to solve this is to create a variable to check if you're colliding with the platform or not and if you are, check the y-position until you're above the platform to allow you to pass through or to stop you. I also used this to allow the player to fall through the platform if they're holding down on it. This was technically intended for allowing sloped platforms but I never used any because I preferred blocky level design.
@Exilum
@Exilum 5 месяцев назад
I didn't something similar in 3D for a end of studies project. Rather than check constantly, which doesn't work at scale, I only checked on collision, and then changed the behavior right away. Because I was on Unity and due to how their collision system is built, I just kept it "on" at all times and disabled it if the collision met my criteria (the call was the first step in handling the collision, and changing it to a trigger simply changed the behavior later in the call chain). I could then just enable it back when the character exited the box. One benefit of this approach was that it was not expensive and was still consistent. One drawback is that it was dependent on engine behavior, we couldn't know if another version of unity could break it. But in the context of our project, we could take the risk, as upgrading our unity version wasn't a current or future requirement.
@HerraHissi
@HerraHissi 5 месяцев назад
It's more resource efficient to shift the logic from the static platforms to the moving entities passing torugh. Implement a collision check and snap entities above the tile if they try to pass trough them from above. It also enables more than just one entity to do the same simultaneously as the platforms keep their collision state the same at all times.
@nonexistent2341
@nonexistent2341 5 месяцев назад
This lil birb is so cute!
@STNDD
@STNDD Месяц назад
Godot: I don't have such weaknesses
@umapessoa6051
@umapessoa6051 Месяц назад
Godot sucks, make your own engine and stop depending on shitty things.
@Thedarkwaterbun
@Thedarkwaterbun Месяц назад
@@umapessoa6051L take
@Thedarkwaterbun
@Thedarkwaterbun Месяц назад
@@umapessoa6051awful take
@obviouslymilk
@obviouslymilk Месяц назад
@@umapessoa6051cry
@umapessoa6051
@umapessoa6051 Месяц назад
@@obviouslymilk thanks but i already have 2 well selling games on Steam, good luck on releasing commercial games with Godot 😅
@the_furf_of_july4652
@the_furf_of_july4652 5 месяцев назад
Located a bug: if you have an enemy that can jump, they will bonk against any platform lower than the player’s height. Jumping enemies cannot reach the player from below if they are standing on a one way platform
@salvadorgonzales1
@salvadorgonzales1 4 месяца назад
not a bug, more like NOT A FEATURE YET thing
@MattTOB618
@MattTOB618 4 месяца назад
I think I can think of another problem with this method specifically: what if the one-way platform is tilted in some way? Where on the platform does it compare the player's height to?
@cyanicgames5224
@cyanicgames5224 Месяц назад
I think it would be better if each entity's script checked if it should collide with platform depending on the Y position, So that the platform collider is always active but player and enemies ignore it if their position is lower. This way both player and enemies could move through the platform and collide with it from above at any time
@cassandracollins4150
@cassandracollins4150 6 месяцев назад
Should make it more dynamic and any sprite that is below it ignores the collision, rather than changing the platform can't the interaction between the spirits and the platform
@tycho25
@tycho25 3 месяца назад
I had never thought of doing it this way. Pretty cool.
@DarthTaterz7
@DarthTaterz7 4 месяца назад
Very helpful my guy!
@srqubit9480
@srqubit9480 Год назад
for my games I use the method of If Yspeed > 0 : it will be traversable and if Yspeed
@srqubit9480
@srqubit9480 Год назад
I use python and pygame
@hiiambarney4489
@hiiambarney4489 Год назад
So what if you start falling exactly as you traverse the collider?
@nightwintertooth9502
@nightwintertooth9502 9 месяцев назад
​​​​@@hiiambarney4489good use case for fixedupdate to catch it before the next frame. Race conditions are fixed by correctly ordering physics checks. In good patrern uodate should never check or update physics it is on a different framerule entirely so this couldnt happen. 😊
@cheekygiraffe9848
@cheekygiraffe9848 8 месяцев назад
i have an odd urge to think scratch code
@tPlayerioT
@tPlayerioT 8 месяцев назад
​@@hiiambarney4489could be there a check if collider is still inside the static body
@_anlim309
@_anlim309 6 месяцев назад
This might be a dumb question, but isn't this potentially a major performance issue? Since every collision is checking the player position at all times?
@kuobah
@kuobah 4 месяца назад
Immediately went into the comments as soon as I heard "platforms constantly checking if character is above or not"
@The-EJ-Factor
@The-EJ-Factor 4 месяца назад
In my games I just check if the y momentum is greater than 0 then it doesn’t collide.
@kytkeyboardsyoureterrific439
@kytkeyboardsyoureterrific439 5 месяцев назад
Cool! I love learning about games
@TrickyMickTrucking
@TrickyMickTrucking Год назад
Yes! This is exactly what I'm looking for to create multiple layers for players to go in between like in SMB3! It's my favorite feature of that game!
@TuberTugger
@TuberTugger Месяц назад
love me some "always checking" platforms that totally scale with the size of the project.
@oscarescobar6876
@oscarescobar6876 6 месяцев назад
I made a type of terrain It is intangible if your movement is upward or if you are inside it, if you stay at the same height or if you move down, the platform is solid. Additionally I made it so that if I pressed jump while crouching my character would check the pixel right below him, if it was this terrain then I would move my character down one pixel, this way I could also go down the platform whenever I wanted. Although in my project it was my character who did the terrain checks, not the terrain.
@trajectoryunown
@trajectoryunown 4 месяца назад
This just gave me an idea for a simple game. Thank you!
@studybruh
@studybruh Месяц назад
Gosh I Was thinking about the mechanism behind this thanks a lot
@sparklee82
@sparklee82 3 месяца назад
Imagine doing it this way but for multiplayer. Ya u gonna get alot of bugs. But this is perfect for a singleplayer
@thisguy.-.
@thisguy.-. 5 месяцев назад
2 things: One - I really like how you explain how it works (fundamenrally atleast) instead of just giving tutorials with pre-made assets, learning how to demystify black box game logic is a huge part of advanced game dev and I love it Two - as far as your solution goes, I won't say its performance problematic unlike other people, I think it's just fine for the scope of the project. But I would like to suggest that a more individual approach that focuses on general game objects instead of just the player would boost level and enemy design ability since it would allow enemy AI to take advantage of the game mechanic which is kinda hard but super worth it
@adrianbunea2006
@adrianbunea2006 6 месяцев назад
Each object checking your height means a lot of computing. You could have the player check when it's colliding with the platform wether it's above or not. You would only need to check for one node (player) only once, at collide event
@arkin0x
@arkin0x 5 месяцев назад
this is helpful! thank you!
@Zanarkand_0
@Zanarkand_0 4 месяца назад
Always wondered how they did that. Thanks
@oxintoma32dev
@oxintoma32dev 5 месяцев назад
Yo this is helpful, thanks man
@carson2889
@carson2889 6 месяцев назад
could just make a custom collider script for those platforms that adds a check on collision enter to see whether it was the player that collided and, if so, whether they are above or below the platform. Cuts down heavily on checks per minute and should still provide exactly the same functionality.
@ParmEsanXP
@ParmEsanXP Год назад
This was more helpful then you can imagine
@gegart01
@gegart01 4 месяца назад
Thank you, brother
@Darkwolfsbane
@Darkwolfsbane Месяц назад
This'll definitely help. Making a metroidvania, and if you want to know how many of these are in one, play through one and take a drink for every new one you see.
@olimor1
@olimor1 4 месяца назад
I made different collision layers, one collier on the head that doesn’t collide with one-way platforms while body and feet do. when head overlaps with one-way platforms it changes the body and feet colliders to a “head” temporarily and when they exit it (either from jumping over it or falling below it they change back. This leaves less processing power (I think, since it only has to check colliders which it does anyway and not constantly check the Y axis of the player for each platform) and you can add this to enemies so they can jump through too! For this the platform needs to be thinner though, otherwise falling through the edges gets a bit wonky Another thing is that landing on a platform with your mid-body makes it shake but that’s fixable with side of body colliders that stops positive or negative horizontal movement and in this case because it’s a one-way disables it like the head All in all, instead of checking constantly it only checks when it collies followed by a bunch of if statements to determine what to do Again, I don’t know if this is better for the cpu but I believe so
@stealth3122
@stealth3122 5 месяцев назад
You could instead add a collider that sits under the other collider. If player hits the bottom collider make the platform passable otherwise do not.
@atulraut4158
@atulraut4158 4 месяца назад
Amazing man
@Xarxes104
@Xarxes104 5 месяцев назад
That's trippy, much like the earlier contra games
@nikolacatlak9875
@nikolacatlak9875 5 месяцев назад
another cool frsture you should include is holding down and pressing jump to fall through the platform
@donutdude4174
@donutdude4174 2 месяца назад
For new Devs, it's best practices to eliminate unnecessary checks especially every frame all the time. In this case, U can use a proximity hitbox to trigger the check. Or Trigger check on every frame for X time when player jumps. Or when not grounded. Or the moment Y changes.
@CuteKyuubi
@CuteKyuubi 4 месяца назад
However if you want this to work for multiplayer, you can instead use a Y speed check to see if the targeted plater is moving up or down
@BobzBlue
@BobzBlue 5 месяцев назад
Im just thinking of the place sound effect in mario maker, "semi-solid platform"
@LapizMsI0
@LapizMsI0 4 месяца назад
Instructions unclear: birb has been stuck when i came from the side
@ssbmbardon
@ssbmbardon 6 месяцев назад
butter building my beloved
@bluematter435
@bluematter435 6 месяцев назад
eyy this is a case where it makes sense to have the origin of the player at the bottom of their feet, but you of course can also do it with an empty, if say you wanted the player sprite to rotate from the middle and not from the bottom
@WooperZzz
@WooperZzz 5 месяцев назад
If you have a lot of these checking every one constantly could be bad for frames and unoptimised. You could add an area where these get checked, so its not slowing performance
@morrisroberti1205
@morrisroberti1205 Месяц назад
This is clearly a naive way to do it but I really like these reels where you explain this basic things on gamedev by example, keep doing this plz
@JolanXBL
@JolanXBL 5 месяцев назад
Very Dreamland esque music ^_^
@elHonguito
@elHonguito 2 месяца назад
I have another solution that doesn't involve platforms checking on every frame Instead of using a box shaped collider, use a plane or a quad as a collider. Planes and Quads by default are one sided objects, being the front face the one with the collision, so if the player goes through it from below, it would ignore it until the player stands on top
@rizenos955
@rizenos955 2 года назад
Amazing video
@LuminousLead
@LuminousLead 5 месяцев назад
I like the bird animation.
@hogandromgool2062
@hogandromgool2062 4 месяца назад
This could become quite expensive. The best ways to do this is to disable player collisions when jump is active OR check if the player's directional heading is up, if so we disable the collision also.
@Eden_Arcane
@Eden_Arcane 6 месяцев назад
This is so cool
@OmarElmasry1
@OmarElmasry1 4 месяца назад
Ok, now i want to play your game.
@amd7407
@amd7407 7 месяцев назад
It was helpful thanks
@JF-um3wz
@JF-um3wz 5 месяцев назад
See, when I tried this way back when for a high school class, I tried solving it by using the motion that you can have upward movement through it, but not downward. The flaw with that design choice is that a player or entity can be partway through a platform like this, which can result in clip-based glitches. By having the platform be in a different state depending on position of the entity it effects, this problem is entirely avoided. This is a really helpful solution to view the problem with!
@iRedEarth
@iRedEarth 5 месяцев назад
I remember going from Super Mario Bros. to SMB2 and this was a big effing deal! Also, top down games having 8 directions instead of just 4. Kids these days will never know how mind-blowing these minor technological improvements were.
@tomasgoes
@tomasgoes 5 месяцев назад
Making Yandere dev proud.
@chloespades
@chloespades 3 месяца назад
"God I wish there was an easier way to do this"
@AbsCmp
@AbsCmp 2 месяца назад
I literally spent an hour trying to figure it out and then I opened my phone to take a rest and this video showed up
@JamAttack
@JamAttack 5 месяцев назад
this probably depends on how much control you have over your platformer physics, but I'd probably just remove the side wall collisions entirely just in case
@kenan2386
@kenan2386 Месяц назад
Run the check during collision, dont run it constantly for all platforms
@Zellonous
@Zellonous 5 месяцев назад
Pet peeve: no down jump on platforms in certain games.
@nutwit1630
@nutwit1630 4 месяца назад
Now i'm imagining a system where just the player shoots out a little "jump bullet" whenever you press the jump button, which tries to collide with an object and, if it does, reads information about the object's position and context, and then tells the player how to jump
@Daftless
@Daftless Год назад
I've read how to make one way platforms and it didn't exactly click fully what I was doing until just now, thanks a lot
@aaroneasterling1044
@aaroneasterling1044 5 месяцев назад
Mario land music is such a good choice 😊
@ethansmit159
@ethansmit159 Год назад
Holy crap man thanks. I'm working on a platformer right now and was stuck on just that issue. I thought I could just go around platforms, but the level design is making that difficult. Thanks again.
@antiktestere
@antiktestere Год назад
release it bro
@spell105
@spell105 5 месяцев назад
If this is what you got stuck on, and you saw this solution and thought "Wow that's a good solution", you shouldn't be making games. Go learn some basic math and programming instead. And I do mean BASIC.
@readyorgormotti4695
@readyorgormotti4695 5 месяцев назад
​@@spell105 person who thinks all true game devs are born with a gene that lets them detect poor coding practice intuitively, without gaining experience first, like some kinda gaming spider sense sorry op you werent born with the power of game dev etched into your soul, better give up on your dreams!
@Orenshaii
@Orenshaii 5 месяцев назад
@@spell105I’d argue that trying to make a game is a good way to learn those things. People don’t have to be masters at their craft before they’re allowed to try to make something cool, and it often helps when figuring out what skills have been mastered and what needs to be improved. Op is doing just fine.
@markkealy4417
@markkealy4417 4 месяца назад
@@spell105 you kinda suck as a person right now, introspect before you lose all your friends
@1337w0n
@1337w0n 6 месяцев назад
Nice Kirby music.
@kaloyantoskov6818
@kaloyantoskov6818 Месяц назад
Meanwhile Godot laughing at you
@LauLauHip
@LauLauHip 5 месяцев назад
I'd probably be more efficient to disable collisions if the velocity of the player is upwards, that way you don't have to perform as many checks
@defenderws
@defenderws 4 месяца назад
Thanks so much
@lordofdarkfate538
@lordofdarkfate538 6 месяцев назад
First thing i programmed was sth like this in BlueJ with boxes and a ball, i didn't even know you could call those hitboxes XD Really cool btw
@imas9121
@imas9121 5 месяцев назад
I will (probably) never use this information but that's super cool anyway lol.
@daleodorito
@daleodorito 5 месяцев назад
I would add an extra trigger collider below the platform to check if the player is in there and while it is, remove the collision of the platform
@darkfrei2
@darkfrei2 2 года назад
Thanks! Do you check the lowest point of bird and highest point of platform?
@Challacade
@Challacade 2 года назад
Yep, every platform has a Y property that represents its upper left corner's Y position, and then it compares that to the birds very bottom point (center + height/2)
@user-bv6bl5im7u
@user-bv6bl5im7u 4 месяца назад
Well if there ever is an enemy capable of jumping to chase you more effectively it could also fall through a platform intentionally (maybe only after the player touches the ground) as a way to keep chasing or to kill/get rid of the enemy if something related is below
@Kwauhn.
@Kwauhn. 5 месяцев назад
You could also achieve this by giving the bounding box a normal vector to compare to the player's velocity during collision checks.
@TheeSlickShady
@TheeSlickShady 5 месяцев назад
Liked and subbed
@thepenguin9
@thepenguin9 5 месяцев назад
If you're watching the video and stuck on how to implement it: Set the collision to disable when the *bottom* of the player's hitbox Y-level is below the *top* of platform's hitbox Y-level
@flaviofael
@flaviofael 5 месяцев назад
In unity you can just use a platform effector and configure it to work this way, it can even include a falling effect where the player can go through the platform downwards jumping and pressing down button
@panek6443
@panek6443 6 месяцев назад
I was coding a game for school and I accidentally made directional platforms. I don't know how, but it happened.
@DqwertyC
@DqwertyC 5 месяцев назад
For anyone using Unity concerned about efficiency, this is a perfectly valid solution, and is more efficient than using a PlatformEffector (unless you want some of the extra bells and whistles PlatformEffector provides). If you want, you could also split the collider in 2, and have one be a trigger that disables the other one, which is about on par with this CPU usage wise. Most of the complaints about efficiency assume your engine lets you intercept the collision and choose to ignore it before the effects are applied, which Unity doesn't seem to allow, at least in what I've found.
@KDYinYouTube
@KDYinYouTube 3 месяца назад
this is one of the example that 3D movement played in 2D world.
@fuylro6r6or6pg6p
@fuylro6r6or6pg6p 5 месяцев назад
Interesting way to solve it, wasn't the first that came to mind.
@paulvictor7489
@paulvictor7489 6 месяцев назад
I feel like watching this I also lerned how clipping works.
@flowrling
@flowrling 6 месяцев назад
in my most recent WIP game, i wanted to make oneways in different directions, so instead of making four objects (onewayUp, onewayDown, etc), i just made one that does trig to check the players distance in relation to its angle and face. sounds complicated, but it was simple enough, and had the added benefit of working in ALL 360 degrees
@biasmushroom6311
@biasmushroom6311 4 месяца назад
I think this might be unoptomized, but I don't have enough programming experience to offer an alternative
@MrJonh95
@MrJonh95 5 месяцев назад
Back in dev school I was doing a 2d game in ue4. The solution I found was to check if the character vertical velocity was positive. If it was then it would ignore collision, but if was negative or equal to 0 then it would block collisions. Jenky but it worked :D
Далее
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
Просмотров 477 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 687 тыс.
choosing a game engine is easy, actually
15:08
Просмотров 303 тыс.
i got laid off... so i made a game...
24:08
Просмотров 605 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 440 тыс.
Can You Actually Beat Minecraft Education Edition?
11:44
What does a Game Engine actually do?
16:45
Просмотров 141 тыс.
The Game That Hacks Your Brain
24:43
Просмотров 478 тыс.
The Internet Played My Game (and it did not go well)
9:27
This Problem Changes Your Perspective On Game Dev
25:51
Animating a STICK FIGHT in 10 Seconds vs 10 Hours
11:53
ИГРОВОЙ АВТОМАТ !! КАБАНИМСЯ
2:39:19