I’m trying to make a 2d platform engine with the character controller, and the CharacterMotor script. The problem is the Character Controller uses a Capsule to collide, which causes the player to slightly sink on the edge of a platform.
I’ve noticed that most of the work is being done in the CharacterMotor script which handles gravity and movement, and I also know that you cannot change the capsule to square ( which would have made more sense ).
Does anyone have any idea as to what i’ll need to do in order to stop the player from slightly sinking at the edge of the platform ?
That is very easy to fix.
When you click on your character, you should see some settings for the character controller.
Then all you need to do is change the position of the character controller along the y-axis.
Thanks for the reply, I did try that just to make sure I wasn’t missing something and it still didn’t work. I don’t think it’s because of the positioning of the character controller but simply because it has rounded edges.
Is there anything else I can do ? I thought of attaching a box collider underneath the character that helps ground it properly, but I’m having troubles with that aswell.
there’s not much you could, short of doing a hacky workaround by parenting a cube collider to the bottom of the character, but then you’re going to mess up your grounded flags/controller collision events. Probably better off using a rigidbody.
Thanks a lot, I’ve decided to just stick to a rigid body instead as it’s too much of a workaround to get the capsule to work.
Are there any 2d platform tutorials for rigidbodies ?