What I want to solve

When I implemented the movement process of the character and made fine adjustments, the behavior that caught in each sprite of the tile map was rarely seen, so I tried to combine the collision judgments using CompositeCollider2D. I thought.
However, when CompositeCollider2D was implemented, the collision detection between the ground and the character, which was effective before the implementation, stopped working.
The jump process is implemented using collision detection with the ground, and the character cannot move to the jump motion, so I would like to solve this.

Implementation contents

How to make Unity 2D action [ground contact judgment]
The same collision detection process is performed with reference to the above site.

What i tried

With CompositeCollider2D added to the tile map, call bool type variable IsGround, which is the reference for collision detection, with Debug.Log() and check if a collision is detected at the point where the character stands.
IsGround is false on almost all grounds
・True only when standing on the left and right edges of the tile map
It was the result.
If i remove CompositeCollider2D and inspect it, you can confirm that collision detection works properly.


It's been a while since I started to touch Unity, so I may have made a fundamental mistake, but I would like you to teach me what might be the cause. Thank you.

  • Answer # 1

    This was solved by simply changing the size and position of the hit detection object implemented as a child of the character so that it straddles the boundary line of the ground.
    I misunderstood that the hit judgment existed in all of the squares of the specified tile, but I interpreted that it actually existed only on the sides of the square.