Announcement

Collapse
No announcement yet.

[SOLVED] Problem with 2D Character: Acceleration after jumping into the edge of a block from below

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

    [SOLVED] Problem with 2D Character: Acceleration after jumping into the edge of a block from below

    Hey,

    I´m quite new to the unreal engine and ran into an odd problem: Whenever my character (the default 2DSideScrollerCharacter from the 2D template) is jumping into an edge of a solid block (part of a tilemap in this case, but the same thing happens with sprites as well) he gets a strong acceleration (Video). I get that the capsule component is hitting the square hitbox of the block and produces this boost. That doesn´t help much tho.
    Btw: this interaction doesn´t happen if the character jumps from above on the edge of a block. I guess that this use case is handled in the CharacterMovement component. So I tried to find any parameter to address the problem but didn´t find anything. From what I read it´s not that easy to just replace the character collision capsule with a square to bypass this problem.



    I can´t be the only one who ran into this problem using the 2D Template: So does anyone know if there is a convenient solution for this problem or did I just miss the right parameter to adjust?

    #2
    *****bump*****

    Comment


      #3
      So I kinda fixed the problem in a matter that is not perfect but for my purpose it´s enough and is maybe helping others who come across this problem:

      First I set up another box collision for the player that covers the semicircle like so:


      Then on the Begin Overlap Event of the box collision I check if the other actor has the tag solid which I set up for every actor which is supposed to be solid. If that´s true the Jump ZVelocity is set to zero for a 10th of a second. This pretty much kills the acceleration.

      Click image for larger version  Name:	20200214-09_14_09Window.png Views:	0 Size:	74.6 KB ID:	1721102
      Click image for larger version  Name:	20200214-09_13_11Window.png Views:	0 Size:	35.8 KB ID:	1721101

      It is not completely perfect and kinda hacky but working for my purpose atleast. Also works with double jumps. Hopes this helps others who may come across the same problem.

      Comment

      Working...
      X