Hello,
i am new to unity and also to this forum. I searched at google and here but i couldn´t find a solution for my proble, i hope some of you guys can help me.
I created a level with some sprites for the ground and used a box 2d collider for collision detection and this worked well (The playercharacter is also surrunded with a box collider 2d). But know i have some wierd edges in my level and the polygon collider 2d seems to big good for this. I surrounded my whole “surfaces” with it .
But when i know start the game, the player is slowed down and gets stucked from time to time.
Can you give me some hints why this problem can occurs or maybe someone of you ran into the same.
It sounds like you put a collider on top of your player, polygon colliders like other shape colliders try to simulate solid objects by preventing their edges from overlapping and correcting it if they do, this correction doesn’t work properly if one collider is completely inside another collider and will result in strange movement and stickyness. Instead of putting a polygon collider around the whole thing try using an edge collider for ‘invisible’ walls.
If your player has a box collider around him, and the floor has holes, the corners of your player colliders will collide instead of just having the base of it “sliding” on it. Try using something like a circle collider or a capsule collider on your player, if you’re using a rigidbody on your player and trying to climb a slope, the gravity will also make it harder for it to climb.
You can also try to add a platform effector on your level collider