Announcement

Collapse
No announcement yet.

Edge Grabbing- Trace or Collision?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    My code follows crocopede quite closely. First of all the BP runs a trace to find a wall when it's within range, then once it hits, it finds the ledge height, and records a couple of the return values.
    Click image for larger version

Name:	tracing_01.PNG
Views:	1
Size:	253.2 KB
ID:	1114083
    The macros for the wall trace, where the trace comes out of around the chest of the character (hence the +50 float on Z)
    Click image for larger version

Name:	tracing_04.PNG
Views:	1
Size:	163.6 KB
ID:	1114084
    And then the ledge trace
    Click image for larger version

Name:	tracing_03.PNG
Views:	1
Size:	133.7 KB
ID:	1114085
    After which, it checks to make sure you're not already hanging, then attaches the player to the wall using the recorded wall normal as the rotation, and the location and height of the ledge, and also stops movement so you can jump but can't slide about.
    Click image for larger version

Name:	tracing_02.PNG
Views:	1
Size:	120.5 KB
ID:	1114086
    I then have a sphere collider that checks for worldstatic and worlddynamic objects, but this doesn't pick up the moving platforms, these are the settings of the collider
    Click image for larger version

Name:	tracer_05.PNG
Views:	1
Size:	153.9 KB
ID:	1114087
    The cubes I have in my scene block the tracer, as does the floating platform meshes, but only the cubes work.

    I do plan to redo the tracing to work as you suggested KrautPotato, but I'm still relatively new to raycasts so I want to fully understand the functionality of them before I experiment

    Cheers

    Leave a comment:


  • replied
    Or post your raytrace code and your settings

    Leave a comment:


  • replied
    You could play around with different collision channels for your moving platforms that would trigger it regardless. A quick-stop fix at the least.

    Leave a comment:


  • replied
    I had a play around with raycasting using Crocopede's tutorials and it works fairly well barring a few problems that I will probably address later on, or I'll rebuild the whole trace process to something a little more specific to my plans. However it doesn't seem to collide with my moving platforms. The moving platform is an actor Blueprint with a floor static mesh, which is set to a worlddynamic object type, and the trace should pick this up. Is there something I should set here in order for a trace to pick up a mesh within a BP?
    I can provide images if need be later on

    Leave a comment:


  • replied
    That makes a lot of sense now I think about it, as it'll be able to trigger provided that floating ledge isn't too thin, I'll have to make sure my platforms have a decent enough height/thickness to them.

    Leave a comment:


  • replied
    You could use 2 raycasts (trace channel / trace for object doesn't matter really much). One in front of your characters face, and one a little bit above.
    If the first one is blocked, and the 2nd one isn't -> ledge.
    So you don't have to place extra climb objects. But you have to be carefull with your level design.

    Leave a comment:


  • started a topic Edge Grabbing- Trace or Collision?

    Edge Grabbing- Trace or Collision?

    Hi all
    I've been making a basic-ish 3D platformer, and it's got to the stage where I'm going to implement a ledge grabbing mechanic.
    I'm not looking for anything too in-depth; I pretty much plan to have the player grab a ledge when you hold a button while falling (similar to Tomb Raider), so when you let go of the button you'll fall, and when you press jump, you're launched up into the air. However I don't plan to have any ledge climbing/shimmying, so it's not overly complex. You simply grab, and your options are to either jump up, or drop down; no side to side movement.

    I've been looking up the video tutorials by Crocopede and the work Alex3d did in the past where they use trace by channel/ trace for object methods, but I've also seen the easier method with colliders manually placed around geometry which might be all I need for my basic level of edge detection. From my basic knowledge, the trace methods would be good, but I don't know if it would work on floating moving platforms as I don't know if it would trace for a floating ledge above the player. And regarding colliders, I don't know if it'll work on moving objects as they'd surely need to be a child of the actor but might be a bit weird. In short, the moving platforms are kind of key to making the right decision for the whole mechanic

    Does anyone have any helpful advice for this or what might be the best course of action before I get too bogged down in the wrong direction. And if I go with traces, what's the key differences/pros & cons between Crocopede's trace channel, and Alex3d's trace for object?

    Cheers!
Working...
X