Ledge Grabbing Tutorial Unreal Engine Blueprint

  Рет қаралды 8,268

The Game Dev Cave

The Game Dev Cave

Күн бұрын

Пікірлер: 66
@lewashiCasual2003
@lewashiCasual2003 Жыл бұрын
Hi, this is a really helpful start. One problem with the ledge grab is that it will ledge grab both ledges and walls; you can grab onto a tall wall and continue hopping up it, which is not desired. I created 2 more line traces, one parallel to the second line trace with the z value +50, this one checks if there is more wall per say above the impact point. If there is more wall, there is no more tracing, if there isn't, do a final line trace, one parallel to the one we just made but with the z value - 40. This trace checks to see if we are too far above the ledge for it to be considered reasonable to hook onto. If this check also passes, _then_ we do the impact trace you made last. So my system goes: your first line trace, my 2 line traces, and your last line trace. - First line trace: 1st trace in video - Second line trace StartVec = (x val of Actor Location, y val of Actor Location, [z value of 1st line trace's Out Hit Location] + 50) - Second line trace EndVec = (x val of [Actor Location + {Actor Forward Vector * 50}], y val of [Actor Location + {Actor Forward Vector * 50}], [z value of 1st line trace's Out Hit Location] + 50) - Third line trace Vec values = same calculations but instead of +50 just do +10 - IF Second Line trace is false (if there is no more wall above our impact point) AND IF Third Line trace is true (if we are not too far above the ledge), THEN do the fourth line trace - Fourth line trace: 2nd trace in video
@thegamedevcave
@thegamedevcave Жыл бұрын
that is why, at the end of the video I make a custom trace channel, and only do my line tracers on that channel, by default all actors are set to ignore that channel but you can then , in any blueprint, or even on an individual actor in a level, enable that collision to block the custom channel and allow the player to grab onto it. that saves the 2 extra line tracers and also introduces less chances for edge cases where things may get buggy, as you have very exact control over what the player can even grab onto in the first place.
@lewashiCasual2003
@lewashiCasual2003 Жыл бұрын
@@thegamedevcave Ah I saw that part of the video! But let's say you have a wall that is a part of that custom collision channel, so you can ledge grab onto it. Even with the custom collision channel, if the player does a small jump and hits the wall, the ledge grab will activate whether we are on the wall or the ledge of the wall. If I want to make a game with wall jumping as well as ledge grabs, or just have a tall object that is part of that collision channel, that would be the problem we'd run into.
@thegamedevcave
@thegamedevcave Жыл бұрын
@@lewashiCasual2003 of course, if you have a very common situation in your game where you'll want the exact same mesh to work as both a wall, and a ledge, hard coding in those extra tracers might work best. Still, i'd probably more likely add some colliders to the top of the wall that are visible to the custom channel but both methods work fine for different purposes
@lewashiCasual2003
@lewashiCasual2003 Жыл бұрын
@@thegamedevcave that makes sense! looking forward to more ue5 tutorials from you; underrated and very helpful in creating game systems.
@rancheraosborne
@rancheraosborne Жыл бұрын
I had same issue, I figured out a way to solve it, in my case it is a 3D platformer, so I want wall sliding, but I think would be the same if you do not need it. I added a capsule trace above player´s head pointing forward before all this other ones, if it hits then branch is true and would mean that the player is lower than the ledge and will actually hit the wall so wall sliding logic happens. If doesnt hit then the other logic runs and will grab the ledge. In case you do not need wall sliding, you could say, if trace hits then nothign happens, keep falling. I hope it helps for you or others with same issue that need to solve.
@No1001-w8m
@No1001-w8m 8 ай бұрын
This is a good tuto video. Other videos from other KZbinrs just speed through without explaining in detail, leaving us begginers confused.
@mileman5072
@mileman5072 Жыл бұрын
Great tutorial mate! I love how you explain what you are doing and why!
@thegamedevcave
@thegamedevcave Жыл бұрын
Thank you! Cheers!
@foolishkoru7197
@foolishkoru7197 5 ай бұрын
get velocity at 1:30 just appears out of nowhere? please explain
@thegamedevcave
@thegamedevcave 5 ай бұрын
i just cut out a typo... literally just "get velocity" from the character movement component and you are good to go!
@alxdrksoul
@alxdrksoul 5 ай бұрын
if you don't know how to "get velocity" out of the character movement component, maybe learn the basics of UE first before watching tutorials for very specific topics or mechanics.
@foolishkoru7197
@foolishkoru7197 5 ай бұрын
@@alxdrksoul Based
@Tramicful
@Tramicful 9 ай бұрын
Great tutorial, thanks a lot, love your way of explaining things, always great to mention shortcuts too.
@thegamedevcave
@thegamedevcave 9 ай бұрын
You're very welcome!
@ScrumpyDumpy6969
@ScrumpyDumpy6969 5 күн бұрын
I don't know if your still looking at comments on this but everything works except the the Hang Jump animation is constantly replaying when I get on a ledge, the other blueprints is just a frankenstein of other tutorial videos, great video btw
@thegamedevcave
@thegamedevcave 5 күн бұрын
very likely something going wrong in the animation blueprint with the state machine. there should be a state for the hanging animation that is entered when your "ishanging" bool variable is true and then proceed to the "hang jump" only when that bool is set back to false (after you jump) so either the state machine transitions have an issue or the bool variable is getting changed before it should
@luigiisgreen
@luigiisgreen 3 ай бұрын
I was successfully get the mechanic to work, but I ran into an issue regarding the gravity space. The physics bones in the tail of my character start to float back to the default position when ledge grabbing. Do you know if there is a way to filter physics bones from the gravity space change?
@thegamedevcave
@thegamedevcave 3 ай бұрын
Not sure, maybe you can set the movement mode to flying instead of setting gravity to 0, maybe that’ll prevent the issue you’re having
@CalianPalace
@CalianPalace 2 ай бұрын
It is posible to only grab to the edge when you hold your action button? Not automatic grab. Thanks 😃
@thegamedevcave
@thegamedevcave 2 ай бұрын
yup, instead of doing this all in event tick you can simply hook this all up to the triggered pin of your input action. that way it'll only run all this code as long as youre holding down the button. or even on the started pin, so it'll only run once when you press the button if you prefer
@dafe1115
@dafe1115 Жыл бұрын
Been trying to do the same method for a 2d game. It seems to just rotate the character and makes them fall
@PANDA-wz8fz
@PANDA-wz8fz 8 ай бұрын
bruh there are 20 different get velocity and u make a cut scene so noe one know what you picked
@RealVergilSparda
@RealVergilSparda 11 ай бұрын
i just dont understand why the line trace seems to happen multiple times for me, also my character teleports on top of the object instead of infront of it, also is it possile to make this not require falling down? i dont want that for my game so
@amanitamuscaria5863
@amanitamuscaria5863 Жыл бұрын
Can I do this without the event tick?
@thegamedevcave
@thegamedevcave Жыл бұрын
no you'll need to check with a line trace during every frame that your character is falling, so you'll need to use Tick
@CloudlessStudio
@CloudlessStudio Жыл бұрын
you can do a set timer by event, start it on a jump or fall, and invalidate it should the player hit the ground or grab a ledge
@DMPROD03
@DMPROD03 Жыл бұрын
@@thegamedevcave You can use timers or a timeline. Event tick isn't needed, and it's better to not use event tick. There are probably more creative ways than timers or timelines also but those were just off the top of my head.
@thegamedevcave
@thegamedevcave Жыл бұрын
@@DMPROD03 people are over obesssed with avoiding tick. Some things simply need to happen every frame, you could probably get away with using timers on this but doing 1 line trace a frame really isnt an issue. The reason event tick is discouraged is because beginners have a bad habit of throwing everything in there which is indeed bad. You dont need to check and set every value on every actor on each frame. A result of this teaching though is that people go all yhe way to the other side and think ever using tick at all is bad. Its not, its there for a reason you just need to be aware of when to use it and when not too. There very rarely is a blanket " X is bad and Y is good" in programming. Having an understanding on what and when to use whicg options for what reasons is key to writing reasonable code
@DMPROD03
@DMPROD03 Жыл бұрын
@@thegamedevcave Yeah, my point was just that is is possible without tick. I do agree that using event tick isn't always "bad"; however, I do believe it's better not to when easily avoided. Also, yes thank you for pointing out that there is not much of "X is bad and Y is good" because that is something very commonly mistaken amongst beginners. Coding and programming is very malleable which is important for people learning to understand because it is a good and bad thing. You can often find different ways to do the same thing and no two programmers are going to end up with the same code.
@leavemealoneimjusttrynavib2687
@leavemealoneimjusttrynavib2687 6 ай бұрын
Whenever trying to jump from hanging, my player doesnt go up he just stutters a lot causing him to re line trace back onto the ledgem
@thegamedevcave
@thegamedevcave 6 ай бұрын
sounds like it's doing line traces at all times, isntead of just when fallign down, make sure you have a branch to check if the Z velocity is less than 0
@leavemealoneimjusttrynavib2687
@leavemealoneimjusttrynavib2687 6 ай бұрын
@@thegamedevcave It only does line traced when falling. But since the character is stuttering up and down after trying to do it. It has a negative velocity for a few frames causing it to re line trace.
@No1001-w8m
@No1001-w8m 8 ай бұрын
Is it possible to make character grab while jumping up too and not use tick event ?
@thegamedevcave
@thegamedevcave 8 ай бұрын
you can do it on a timer instead, checking X times per second instead but this is the kind of thing you really want to be doing every frame honestly
@bakmau8330
@bakmau8330 9 ай бұрын
This is a great tutorial! I set this to automatically play a mantle montage instead of having to wait for a second input which I prefer. I have an issue where the line trace is in world space not local space. Its most noticable when you increase the cast distance to 150, any idea to be sure its local to the character's current facing and not the world?
@bakmau8330
@bakmau8330 9 ай бұрын
ah nm I found that if set off the capsule forward it works better
@lordyingyang
@lordyingyang 4 ай бұрын
Where did you add the montage? I'm trying to do the same thing as I just want auto grab instead input.
@bakmau8330
@bakmau8330 4 ай бұрын
@@lordyingyang after the set movement node I followed with a "Play Montage node" that triggers the anim
@kyorage
@kyorage 10 ай бұрын
Hi! im having an issue that have been unable to solve. Everytime i jump to a wall (a collision being registered) my character gets teleported to the left corner behind this same starting map u are using here. I did it all exactly as the video says, thanks in advance.
@thegamedevcave
@thegamedevcave 10 ай бұрын
sounds like your character is getting teleported to location 0,0,0 . check Set actor Location node to make sure that the location is connected properly
@kyorage
@kyorage 10 ай бұрын
@@thegamedevcave Oh Thanks! ill check that as soon as i can
@maikpinto8485
@maikpinto8485 6 ай бұрын
@@kyorage you fixed this? im having the same issue
@JayGeeUnofficial
@JayGeeUnofficial 5 ай бұрын
Great tutorials. But for some reason it dont work on all wall/ledges.. Any suggestions ? *EDIT Nevermind i was using the wrong forward vector....
@alonshamash9343
@alonshamash9343 7 ай бұрын
If you are talking about falling that you explained in previous video you should link to it. Going through your tutorial and got stuck because can seems to find what video you explained that part....
@thegamedevcave
@thegamedevcave 7 ай бұрын
i dont think this video should rely on any previous video's ive made? what part are you getting stuck on?
@daddystewart
@daddystewart 6 ай бұрын
@@thegamedevcave The state machine/event graph portion at 12:53
@daddystewart
@daddystewart 6 ай бұрын
@@thegamedevcave At 12:53 I assume.
@iamgamerwatchmegame
@iamgamerwatchmegame 6 ай бұрын
@@thegamedevcave12:53
@mrjoneslol
@mrjoneslol 4 ай бұрын
Amazing. Thank you!
@haxan4786
@haxan4786 8 ай бұрын
I love it, comment for the algorithm!
@thegamedevcave
@thegamedevcave 8 ай бұрын
appreciate it!
@PANDA-wz8fz
@PANDA-wz8fz 8 ай бұрын
what is this kind of tutorial ?????????? íts like a maze event trick it says delta second how do i get this when i put there an event trick it isnt there
@thegamedevcave
@thegamedevcave 8 ай бұрын
i'm going to assume you're pretty new to the engine, i'd really strongly advice doing over some of the basics first before trying to dive into a feature specific tutorial because most people making tutorials on features are going to assume you have a good understanding of the basics so they dont have to re-explain every fundamental thing in every video they make :) as for this specific issue, event tick is a premade event that the engine provides, you dont make your own.
@lewashiCasual2003
@lewashiCasual2003 Жыл бұрын
Thanks for the video, really helpful start
@pandasdreamlygon
@pandasdreamlygon 9 ай бұрын
this doesnt work on first person or?
@thegamedevcave
@thegamedevcave 9 ай бұрын
the code should pretty much work the same way yeah, but you'll end up with your camera inside or right up against the wall, so you may need to add some stuff or change things to make it work a bit better for that viewpoint
@ShadowHost99
@ShadowHost99 10 ай бұрын
Is this in Unreal Engine 4 or 5?
@thegamedevcave
@thegamedevcave 10 ай бұрын
should work on either
@joeypouladi
@joeypouladi Жыл бұрын
Super Helpful 👍👍
@ericdrob
@ericdrob Жыл бұрын
Yer a saint!
How to Create a Map EXTREMELY FAST in UE5
9:55
Evans Bohl
Рет қаралды 184 М.
Unreal Engine 5 Tutorial - Walk, Run, and Sprint Toggle
7:47
The Real Unreal
Рет қаралды 55 М.
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
Как Ходили родители в ШКОЛУ!
0:49
Family Box
Рет қаралды 2,3 МЛН
How To Set Up The Ultimate... Ultimate True First Person Camera - Unreal Engine 5 Tutorial
15:53
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 20 М.
Learning Unreal Engine in One Month to make a Game!
15:25
Will Hess
Рет қаралды 114 М.
The Easiest Way to Make a Simple Enemy AI in Unreal Engine 5
15:40
Gorka Games
Рет қаралды 310 М.
How to Make a Run and Stamina System in Unreal Engine 5
13:10
Gorka Games
Рет қаралды 68 М.
UE5 | Ultimate Dialogue System - Tutorial - Pt1
29:07
Michael Pattison
Рет қаралды 39 М.
How to ACTUALLY Load Levels in Unreal and Make Loading Screens
16:31
The Game Dev Cave
Рет қаралды 63 М.
How To Make A 3D Interaction Prompt In Unreal Engine 5 (Tutorial)
6:22
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН