
It looks like you're new here. If you want to get involved, click one of these buttons!
So i was making a simple 2D game. I added a 2D boxcollider to an emptyobject to create a border so my character wont go outside the scene, but as soon as player collides with the emptyobject's collider, player's collider gets disabled and it falls though the ground.
Another problem that occurs, is that when going through areas between lower terrains and the ground plane, i discovered that the boxcollider2D of the player constantly turns on and off by itself, making the player flicker in these areas, but the area formed by the boxcolliders of ground and terrain arent too small for the player's collider, why is this happening?
Did you put the collider of the player in the coruch disable collider slot? If yes, then remove it, I think that causes the problem
Make 2 separate colliders: one on the top half and one on the lower half, and disable the top one when you crouch. The top one can be a simple box collider, and the bottom one a capsule, in this way it will not be bigger, than the sprite
Answers
Hi!
What controls script do you use?
@ComradePingu i used the CharacterController2D provided by Brackeys in his 2D character movement course on YouTube.
heres the link to the github where i downloaded the script.
https://github.com/Brackeys/2D-Character-Controller
@ComradePingu ah yes, thank you. but then i cant crouch. is there a way to solve it by changing a bit of the script?