Basically everywhere I searched told me to use tilemap colliders and composite colliders for scene construction, but when I started using it, it gave me some errors that I didn’t understand:
At first, composite and tilemap colliders made these weird corners that caused a lot of problems with my capsule collider in Player:
When I’m going right, RigidBody’s velocity in Y axis stays at about -1.9 and when I’m going left, it stays at about 1.9 (which probably means the collider makes a “ramp”, going down to the right) even though the RB shows the Y position doesn’t change.
I made the exact same test with box colliders and edge colliders and they work correctly with my player’s RB, so the problem is definitely in tilemap collider and composite collider.
For now I will keep using Edge colliders but it is way more exhausting than the tilemap collider method, so I would like to know why are these errors happening to me.
Anyways, thank you for reading this and sorry about any possible errors that I probably have made, I’m new to this platform. xD
People say a lot of things, knowing why it’s used in a specific situation is more important to understand.
Note that Unity colliders are not what the physics system sees, it only has a few primitive types it understands and the Unity colliders just create those primitives. What you see is what you get so those gizmos show you. The physics system only understands polygons, edge-chains, circles and capsules.
So are you using “Outline” mode for the CompositeCollider2D? It seems you’re using Polygon mode which isn’t equivalent to using the EdgeCollider2D (which produces edge-chains). Outline mode produces edge-chains.
Not sure what else to suggest apart from the point I mentioned above which is ensuring the gizmos show the collider edge. A composite using outline mode is identical to an edge collider as long as the edge is still there. This is the reason I mention that the physics system knows nothing about composites or edge colliders.
Also, a critical part of understanding the issue is knowing about the Rigidbody2D body-type involved and how it’s being moved and ensuring you’re not doing anything to causes issues such as modifying the Transform etc.
So this is a Dynamic body-type I presume and you’re using the automatic collision response it provides? Also, as I asked above, is there an actual collider line where you expect it when in outline mode?