Square objects vs character capsule collision in paper2d

How can i get rid of this?

(sorry for poor resolution)

1 Like

Hi Tafonath,

I have a couple workarounds to mention that may work. The problem itself is the capsule component. The collision that is set up for collision component would require editing the CapsuleComponent class itself in code.

For the first workaround you could replace the character with a pawn instead. This’ll allow you to use a box collision instead of a capsule collision. For the second workaround, you could try setting a box component on the character anyway and turn off the collision for the capsule component.

Hope this helps!

Second workaround unfortunately doesn’t seem to work, first is what i was looking for but… the collision is weird , not only for box but also for capsule. My character is floating above ground.

Would it be acceptable to offset the collision box to be from Mario’s waist and up if it is colliding a little off the ground like in the 2nd picture? Does this collision work correctly for the blocks and the pipe? I’m not sure exactly what you’re using for the collision (I assume there’s an actual floor in 3D space that is being covered up by paper2d).

Yes, ground is basically default 3d adjusted to the tile map. The square box collision works fine, it was my bad i didn’t know pawn don’t have movement component and he just hung in the air where i place it. Only sphere collision causing this few pixels gap problem (yes also on boxes pipes and every other sprite/flipbook). If i may, I have another question : how can i add movement component to pawn so i could use it like a normal PaperCharacter?

The simplest way would most likely be to create a PlayerController blueprint. If you make one of those, you can then set the Default Pawn Class to your Mario pawn and Default PlayerController to your new PlayerController in the game mode (If you haven’t already made a custom Game Mode as well, you’ll need to do that) by going to Edit → Project Settings → Maps and Modes → Default GameMode. You can then move the pawn using the PlayerController, although it will need to be set up.

Hope this helps

I’ll try, thanks very much for help !

I’m having the EXACT same issue, and adding a collision box doesn’t work, my character is still bouncing around.

Hello SB1985,

Can you explain what you mean about the character bouncing around? The reason that the original poster here was having an issue was due to how capsule components are curved at the top and bottom. When that curved edge met with the sharp edge of the blocks, it would slide off instead of just stopping him. In his case, adding a box collision fixed his issue. If your issue is different, please make a separate post so that the two issues don’t get mixed up.

Well the issue is like you described, and the box that I add (around the capsule) doesn’t “exist” in-game, so when the character hits sharp edges he still gets pushed. I looked for a solution online, and found this post, it’s basically the same scenario, I just can’t add a box :confused:

I’m not quite sure how this would happen but it would require knowing how your project is set up. Would you be able to provide me with a copy of your project so that I could have a look at this issue? If you would like to keep this project private, you can send it to me through a private message on our forums. My forum username is .

The reason the box isn’t working in this case is due to it’s position in the hierarchy. As I mentioned to Tafonath, I suggest using a Pawn instead of a Character if you wish to use a box collision, as the CapsuleComponent cannot be replaced as the root in the Character’s template.

I found an alternative. It’s kinda a hack, but it works for my project, The tag needs to be the same on objects you don’t want to bounce of the edge, in my case “SolidFromTileset” in your case you can add whatever tag you want, just make sure you apply it to the object as well.

In your Character Blueprint add this:

Then select the object that annoys you with the bouncing, and add the same Tag that’s in the Character Blueprint.

It’s not perfect, but it works for me.

1 Like