Jumping Through Platforms in UE4 Blueprints (Super Mario mechanic!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today we're going to look at how to do jumping underneath a platform in unreal engine so if you've ever done a platformer game where you need to jump from underneath a platform onto the platform you may have searched google for a result the first hit will most likely tell you to use a platform with a timer that calculates your position and its position and if you're above a certain threshold to allow you to step on it this is probably the absolute worst way to do it and we're going to cover three other ways to do it as a side note i will be using the terms phasing in and phasing out during this tutorial when two things are phased in it means that they can see each other and collide with each other when they are phased out or something is phased out it means that it no longer sees the other object and as such they will pass through each other so the first method is to use a collider underneath the platform and to have the platform always phased in when you hit the collider it phases out and when you stop overlapping with the collider it phases back in now this is one of the simplest ways to do it uh however you can have two issues with it one of them is clipping one of them is incorrect collisions or at least incorrect uh hitting of the collider that may happen the second method we're going to look at we will install a ray trace underneath the highest foot the platform is phased out until the ray trace detects the hit once it detects it it is finally faced back in and you can step on top of it when you jump off it will be phased out again until the ray trace hits it again the last one is to do the reverse you are always phased out and the platform is always faced in and the same raytrace method applies except that if you hit the platform itself you will actually face in with the platform and stay on top of it the benefit of this is that you don't need to create a actor platform instead you can simply create a static mesh and if you're adventurous enough you can always create instant static meshes so let's take a look at the three platforms in action so the first one here is with the box collider as we can read so if i jump from underneath i'm on top now let's take a look at those bugs that i was talking about so the uh it's not going to clip because i set a first a perfect sort of height but depending on your position of the collider you may go in and then clip immediately into it there is a small clipping here but it's barely noticeable again clip the other issue is if you don't collide correctly with it see so i still went through the platform and that can cause quite a bit of frustration with people like i touch the platform but i'm still going through it the other one is the face platform so it's always phased out unless i go in and bam the ray trace this dust so the ray trace is on top of the foot phased and the last one as you saw i just went right through it because i'm phased out but then i phase back in faced in so let's take a look at the blueprints the blueprint for the box collision is simply a platform with a box collider run underneath it as we can see here and depending as you can tell i'm slightly in the actual platform uh this is the area where it will cause clipping um in and of itself it's a simple graph uh on begin overlap if my player is a player or you can do whatever detection method you want set the collision uh response of the platform to the pawn to overlap or to block simple as that the next one uses a blueprint interface on a single event so if you get a trigger same thing as the previous but we're using a blueprint interface instead to do the check for the blueprint interface what are we doing is we're raytracing below so the first thing we do is we check are you falling if you are following get your world location and we're going to create a ray trace or a line trace and we're going to look specifically for something that is tagged as vehicles so very important to tag as something object types other than what you would use normally for these platforms because they are phasing platforms right so in all of them they are considered in their collision presets as vehicles if you get a hit on a vehicle since nothing else is a vehicle in my setup but you can set up your own different way of doing it if you hit then send then check if it implements the bpi interface and if it does uh set it to your current platform that you're on top and send a message for trigger solid now this is important to set it as your own variable because if you are off of it you need to get a reference to it to tell it hey i need you to phase out again and then set the platform to nothing for the last one the static platform itself is just static the only thing it has is that it's a vehicle with overlapping visibility in camera and blocking everything else if we go into the character itself we're just going to do a face check same thing as the previous one are you following if so check make a line trace and if your line trace hits something either block it or overlap it and that's it so there's no need for an interface and the collision itself is dealt with in this tick and there you go thank you for watching what method would you use let us know in the comments below if you want to see more of these drop us a like and be sure to subscribe for future videos if you want to support the channel check out our patreon where we will be releasing early access builds for games that we are making and voting on future video topics see you in the next one
Info
Channel: Pending Kill
Views: 2,274
Rating: undefined out of 5
Keywords: unreal engine, game development, epic games, unreal engine tutorial blueprint, unreal engine tutorial for beginners, unreal engine tutorial third person, box collider, collider, block, overlap, collision, collision channel, object type, jump through platform, jump under platform, ue4
Id: P1aRnk5A3lg
Channel Id: undefined
Length: 6min 47sec (407 seconds)
Published: Mon Aug 17 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.