Problem Adjusting CapsuleComponent for My 2DCharacter

I’m in a rather unusual situation. Normally, In the blueprint of a typical 2D game, the sprite is put within a root default CapsuleComponent which we can adjust its Half Height and Radius. Also the camera is usually set to an Orthographic perspective in order to conceal the fact that the character with its fat CapsuleComponent is adjusted way in front of the background:

![capsulecomponent2d] (http://i.imgur.com/J2NQuJC.png “Typical Capsule Component”)

My problem is that in my game the camera is in the Perspective (not Orthographic) mode and I really need to make CapsuleComponent almost as thin as as the sprite itself (Its ok if the CapusleComponent is a bit thicker). If I adjust the Radius of CapusleComponent to match the Sprite thickness make, the CapsuleComponent becomes to unusual to detect collisions of the character properly:

![capsulecomponent2d] (http://i.imgur.com/CRJnbEV.png “Unusual Capsule Component”)

One solution that I thought about was to add a BoxCollision like this

![capsulecomponent2d] (http://i.imgur.com/CUDD2WE.png “Unusual Capsule Component”)

But the problem is that the Collision doesn’t work no matter what is the value of CollisionPresets or even if I disable the CapsuleComponent collision still it doesn’t recognize collision of the box. Why the box collision doesn’t work?

I tundestand that currently characters only support capsules. Any other shape of collision will make other dynamic objects bounce from that collision object but it will not block or control character movement, only the capsule control the movement. I have character that use the capsule for movement, while using the sprite collision shape to bounce objects that fall over it.

Edit:

Hmm… I think i get it now. What about some of this possible solutions after making the capsule bigger: - Disabling collision for background wall? - Making the character sprite displaced far from the center of the capsule, so the capsule don’t collide with background wall while the sprite will be close to the wall? - Having invisible objects for collisions with adequate distance each other to work well, while the sprites are child components of this invisible colliders and all get show close in your 2D wall?

  • Out of ideas :slight_smile:

It’s by design. If I make the capsule bigger it collides with the background wall. I want to achieve a 2D feel on a 3D wall with a perspective camera. If it was Orthographic it would have been easy. I just had to move the character to the front and it would have look liked on the wall but I cannot do that.

I don’t get why you need the capsule so thin. Please explain a bit more to see if there is a workaround to achieve the same results you want.

Hmm… I think i get it now.
What about some of this possible solutions after making the capsule bigger:

  • Disabling collision for background wall?
  • Making the character sprite displaced far from the center of the capsule, so the capsule don’t collide with background wall while the sprite will be close to the wall?
  • Having invisible objects for collisions with adequate distance each other to work well, while the sprites are child components of this invisible colliders and all get show close in your 2D wall?
  • Out of ideas :slight_smile:

You are a genius man. Your first suggestion is spot on. Disabling the collision for background seems to work for now. I hope it doesn’t lead to more complex scenarios. Your second suggestion is not applicable because when there character rotates in opposite direction it rotates around the center of the CapsuleComponent which would make the sprit further from the wall. Isn’t your third suggestion is what I’m trying to do with that box collision? Anyway, Thanks a lot for help. I think we should mark this answered.
Can I pick your comment as answer?

haha… not genius just making my 2D game and I have facing many related issues… I’ll copy the suggestions to my first answer so you can mark as answered. Good luck!