Announcement

Collapse
No announcement yet.

Paper 2D Character - CapsuleComponent gives incorrect Collision

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

    Paper 2D Character - CapsuleComponent gives incorrect Collision

    Hi, I am currently making a 2D platformer game using Paper 2D. I am having problems with the CapsuleComponent, it's not giving me correct collision, my sprite doesn't want to touch the ground. In the following image you can see the CapsuleComponent and the sprite-box. The weird thing is that the collision works fine on the X axis (Left to right), but the cube sprite just doesn't want to touch the ground:
    https://imgur.com/a/TuGxc

    I have two questions regarding this topic.
    1. Can I add a box collision since the character is going to be the red box?
    2. If I can't add a box collision, why the heck is the CapsuleComponent acting up?

    Thank you!

    #2
    Hi, to answer your first question, you can't add a physical collider to a Character (as far as I know). If you absolutely want to, you would have to take the Pawn class and make your own CharacterMovement-like logic. Personnaly, I find it unnecessary in most cases ^^

    For the capsuleComponent, did you check your floor colliders ? I assume they are tiles on a TileMap. Did you adjust your TileSet collisions to the accurate size of tiles ?
    If that's the case, maybe the solution lies in the many settings of CharacterMovement. "FlatFloorCheck", maybe, or any Z-offset ? I suggest you send us the complete details of your CharacterMovement settings.

    Comment


      #3
      Thank you Tom, I'll check on those things. Yes I am using TileMaps. I moved the camera a bit further away which hides the gap, I did also offset the sprite about 2 units. So it looks like it's touching the ground. I went into the console and typed in "Show Collision" and there really isn't anything there that should stop it from touching the ground. I'll look at the things you suggested though.
      Out of curiosity can you create a Pawn class and create your own Character-Movement logic using blueprints or is it restricted to C++ programming?

      Comment


        #4
        I assume you can make your own movement logic in BP, but to reproduce every nice feature of CharacterMovement, it's going to be a mess. Maybe you can copy-paste the CharacterMovemement class in your own C++ class and only keep what you need ? Honnestly I don't know what would be the best. I'm launching UE4 right now on my 2D project to see if I can reproduce your issue somehow.

        Comment


          #5
          help, did anyone find a solution for that?

          Comment

          Working...
          X