It works perfectly fine, so long as the bottom of the capsule overlaps a floor, but if only the side or top overlaps, it doesn’t work. Why not? (Or if you know any other way to find a floor within a capsule radius, please let me know.)
I didn’t perfectly get what you meant but maybe it’s hitting something other than the floor. If you want to find the floor, I would do one of two things: use a sphere tracer, similar to yours but simpler, better and bug proof, mostly, because it will find first whats in the center, because of the shape of the sphere. If you want something very simple just use very simple just use a line trace, most of the times you will get the same thing is a sphere in this case, but I aways prefer to use a Box tracer, as it’ll get what’s closest to you, as it’s square, just need to remember to set the rotation right
For example, on my game/project I have a series of animations, when you jump or start falling, it’ll trace the floor (from the pelvis, you can also offset the starting point so you are sure it wont hit anything else), if the distance is higher than say 500, it will do a animation and when it gets to say 150 it will trigger the getting ready to land animation, if the distance is bigger than 1500 the character will get scared and trigger another animation.
Hope this helps, if you need anything else just ask please, also please send a feedback, is the writing good? Anything
Thanks! That’s some useful information! Although, It still doesn’t work, but the box trace did help me understand what’s going on. But I still don’t know how to fix it… Here, let me try and be more clear as to what I’m trying to do:
I’m trying to make a ledge grabbing system.
The idea was: when the trace shape overlaps both a wall and a floor, it will trigger the ledge grab. (Of course, the difference between a wall and a floor is whether the player can walk on it or not.)
I looked at some ledge grab blueprints that other people made, and most of them would use a sphere trace to find the wall, and a vertical line trace to find a floor. The line trace start point would be located a big distance in front of the player. This didn’t work for me however, because my game has some very small platforms, and therefore the vertical trace would “miss” or “overshoot” the platforms. Putting the trace closer to the player is not an option, because I want him to have a long reach.
That’s why I want to find a floor within a shape trace. But as I stated previously: for some reason, only the bottom of the shape can detect a walkable floor. For example: The trace box has 6 sides, but only the very bottom side would trigger the response. In other words, the box must “land” on a floor.
(…Maybe these functions just aren’t designed to do what I want…)
If anyone knows a better way to program a ledge grab, please tell me about it. :3
Hey, awesome, spent the last month creating multiple ledge tracing
I made like 5 different ones, i was even thinking on creating a thread to share my results. Let me break it down for you:
— The most simple way of doing this (very simple) is by having a tick line tracer pointed down, get your player position, add forward vector multiplied by some number to position it at the ideal distance you want and add a number of your like to the Z axys, probably 200, then. You might want to use the original Z location for the end (you dont want the trace to go all the way to the floor). If it finds anything, Now we are going to do a wall line traced (Use branch so it only does it when it finds the top of the ledge). Get the location (subtract a bit from the Z axys (10 is enough)) and set as End. For the starting point use your player location. Or instead you can use just a box/sphere trace and not subtract from the end (use the same Z location). Some adjustments might be needed to get the perfect grabing location (you can offset your player when grabing/hanging).
Pros - Very simple to do and cost effective
Cons - Might not be as precise and if there is another object on top o the one you want, it WILL be blocked
Now the one I use
That`s a much more advanced way to do it:
— I have an array of multiple forwarded pointed line tracers, they will offset down. For each of them that find the wall, i
ll then make a down pointed line trace, if it finds lots of ledges on the way, ill show all the options i have. Then i have a function that calculate the closest to a location i set (I
m getting my player location and offsetting it UP) after the function I limit it to a certain vector length from my head, if its close enough I can grab it.
Right now im using two of those, one for each hand (because I`m creating a very advanced system, controlled by hands and driven by IK and moving, not using animations, it can adjust itself for various offsets and rotations)
Pros- very precise and adaptative, it can find the smallest grabing holes.
Cons - heavy (haven`t checked how much, but certainly more)
Sorry i dont have pictures from my blueprint, i`m not home. Do you think I should post a thread so I can help more people on that?
Hopefully this will help you :D, have an awesome day. You can ask me anything you feel like asking.
Any tracing will only trigger once, so, as soon as the box/sphere/any other, hits something, it dies there. If you want something else, you can use a multi (is that the name) box/sphere tracer, it will tell you all the things it hits.
YES! Please share your work with the rest of us! Ledge grabbing is such a common feature in games, I feel as though indies shouldn’t have to struggle so much just to make what’s already been made ten thousand times before. That way, they can put more time and effort into making what’s new and special about their game! Don’t you agree?
But do me a favor: Show us a demonstration of how the blueprint works BEFORE showing us the blueprint and explaining it. You have no idea how many blueprints I’ve closely examined and/or copied only to find out it wasn’t quite what I was looking for, or didn’t work the way I imagined. (Sorry for complaining, I still appreciate these people for trying to help.)
The very best way to show us would be a video. (You’ll need a “screen recorder software”. If you don’t already have one, I would recommend you download OBS Studio. https://obsproject.com/ It’s free and high quality.)
You’ll probably only need to record less than a minute of game play. (With debug drawing enabled.) Don’t record yourself constructing the blueprint! We only need to see the finished project, thank you. You could simply show pictures for that. And no need to commentate (unless you want to,) I’d greatly prefer text, as it’s scripted and I can go at my own pace. This is the art of a good tutorial.
Sorry, I know I’m asking for a lot here… If you don’t want to do all that, that’s totally fine, I understand. I was planning to do all this myself as soon as I make something worth showing, not sure when that will happen. lol
btw, I haven’t gotten around to trying out the blueprints you showed me in the above comment, but as soon as I do, I’ll let you know how it goes. Thanks SO much for your help, and have an awesome day yourself. ;D
Ah, that’s good to know! : ) (I wish I knew that sooner.) It still only works from the bottom, but thanks anyway.
Hey, good to hear that, so… right now the tracing works very well (really, i have no complains here) the only thing is that I just recently started working on another way of moving the character around, then clean up the blueprint (overall it’s not that big of a mess, but there are some unnecessary things, and i fell like I would be missleading people by doing that, what do you think?
Glad to help
Also, I do have a very brief recording (at the end of the video) on how it looks like, it doesn’t show its real capabilities but it’s there.
What do I think? Well, that depends… You say you started working on another way of moving the character. If you think this will be a straight up improvement over the other way, I think you should take your time and finish it first. If you think that not all people will need their game to work this way, or that it’s pretty much nothing more than an alternative way, then it might be a good idea to show both ways.
If there’s anything that might be unnecessary to some people, but still might be useful to others, maybe you could just tell us so.
Here’s an idea: (I’m still fairly new to programing, so I don’t know just how hard this would be to do, but…) Do you think it would be possible to “separate” your blueprints into separate tutorials. Like, have some tutorials showing different ways to detect the ledge, some other tutorials showing different ways to attach the player to the ledge, some more tutorials for moving along the ledge, etc, and that way, people could easily mix and match these mechanics to fit their needs?
Or I don’t know. On the other hand, you could just show us one thing, and if people want their game to be a little different, they will just have to figure out how to change it themselves. This would probably be more convenient for you, but less convenient for the rest of us.
(Running out of comment characters here… I’ll have to post another comment.)
So, I watched the demonstration video you gave a link to… It looks pretty good! (That’s exactly the kind of thing I want you to show at the start of your tutorials.)
It looks similar to Assassins Creed or Uncharted.
I do believe those games would use traces and/or sensors to detect a ledge, and determine whether the player could jump to it or not. Sometimes, these types of games won’t let the player jump at all if there’s nothing to jump to. Is that how your game works?
The game I’m planning to make doesn’t work quite like that…
In my game, the player can jump at any time when on the ground or a ledge, and steer themselves midair.
So, all I need is a ledge detector while falling, and nothing more.
That’s why I want you to separate your blueprint functions! (If you need to rearrange a bunch of stuff in order to achieve this, then it might be a good idea to make a backup first. Idk, it’s up to you.) That way, I can find what I need, without having to dig through tons of other information!
Btw, I totally understand the fear of misleading people… It’s something I worry about a lot, actually… Like, what if your blueprint works perfect with still, flat ledges, but doesn’t work at all with slanted ledges and/or moving ledges and/or rotating ledges? You might have to experiment with those things to know for sure, and that means keeping the world waiting a lot longer! But hopefully, if that happens, it would be an easy fix. Like maybe just change one thing or two… OR, maybe it will mostly require additional programing (as apposed to re-writing everything). In that case, you could just forget about it for now, and do a separate tutorial later! I wish I knew for sure what will happen…
Hey, thanks so much for asking for my opinion on this! Feel free to ask me more.
Here, I have some more general advice on the subject: When making tutorials, it’s important to think outside the box all the way. Think about the people who view your tutorial, and what might be going through their minds at each moment. Think about some tutorials you’ve seen, and what you liked/disliked about each one.
Don’t rush it if your not feeling completely sure about something. Give it some time.
One more thing I’d like to mention: Indie developers, and the act of teaching ones self how to make video games at home, is something that hasn’t been around for very long. Or at least is only more recently becoming a more common thing. That’s why right now it can be pretty hard to find good help online.
But I believe, in the future things will be much more convenient! So many more people will be able to create their dream games!
You’ll really be making a difference in this world by creating these tutorials! (Seriously! I’ve been searching for info on ledge grabbing for weeks! It’s pretty disheartening… I almost gave up.) Thanks again for all your help.
Yea, the Tracing System is very well separated from the rest of the BP, it’s quite easy to just export to another one, on my game what i do is to look for other things to jump to, if it doesn’t find and you jump to the sides it will just make a random jump. But if it finds something it will go to that location.
The tracing is actually very good, I really plan on posting as soon as I can, but idk when that’s gonna be, i’m really occupied with tons of things, including college (which I might need to start working to pay it, so even less time and maybe even stop at all using UE4). My plan was to release the whole climbing system for free (my dream) but then I would eventually have to stop using Unreal as stated previously (tho I might still do it for the sake of this community), that might be in a few days
Hope you can wait that long, if not just contact me and maybe I can share with you.
Yeah, no worries! Do whatever you want, I can wait. (I’m still young.)
Here’s wishing you the best of luck with life and all that. c;