# Wall-clipping collision issue

**URL:** <https://forum.defold.com/t/wall-clipping-collision-issue/66443>\
**Category:** Questions\
**Created:** [September 25, 2020, 7:11pm UTC](https://forum.defold.com/t/wall-clipping-collision-issue/66443 "2020-09-25T19:11:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [September 25, 2020, 7:16pm UTC](https://forum.defold.com/t/wall-clipping-collision-issue/66443/2 "2020-09-25T19:16:16Z")

</div>

Yes, this is an super common issue and has come up dozens of times:

> [@Merge tile colliders](https://forum.defold.com/t/merge-tile-colliders/64339/2):
>
> Since you use irregular shaped tiles and use the tile graphics itself to trace the collision shape you will potentially run into problems like this. My recommendation would be to use a different PNG for the collision shapes with completely square tiles for the walls instead of the irregular ones tracing the outline of the vines etc

> [@Smoother gameplay / steering player without stuck at collisions](https://forum.defold.com/t/smoother-gameplay-steering-player-without-stuck-at-collisions/11656):
>
> Hey there. I am moving a character (player) on a tilemap. The tilemap has collisions. If the player runs around/near a corner he’ll stuck. Does anyone has an idea how to solve this or how to do it better? Game can be tested here: (Use F9 for the physics debug) [http://foodrescue.trinium.de](http://foodrescue.trinium.de) Here are some code-snippets how the input and movement works: the tilemap is a simple tilemap with 2 layers - a background and a front with some furnitures etc. Nearly all tiles have a collision set up …

Good explanation:

> [@Directional platforms help](https://forum.defold.com/t/directional-platforms-help/18764/31):
>
> Just to be clear, this is not a “bug”! Box2D is working exactly the way it should be. Because Defold treats each tile as a separate shape (for good reasons), life is a bit more difficult than you might expect, but it’s not all Defold’s fault either. Nor is this just a problem with tilemaps. Any time you want to build a continuous surface out of multiple pieces you’ll run into this. Unfortunately, no physics engine can read your mind. Given two overlapping bodies, the physics engine will calcul…

You’re better off using raycasts for platforming collisions rather than collision shapes. Check it out here:

> **[Raycast](https://defold.com/examples/physics/raycast/)**
>
> This example shows how to use physics raycasts to detect collisions along a straight line from a start point to an end point.

> **[API reference (Collision object)](https://defold.com/ref/physics/)**
>
> Defold is a free and open game engine used for development of console, desktop, mobile and web games.

There are also a few platforming assets in the Asset Portal that use raycasts to solve this problem. Maybe try studying them a little bit to learn how they work if you’d rather implement it yourself:  
[https://github.com/britzl/platypus](https://github.com/britzl/platypus)

---

_[View the full topic](https://forum.defold.com/t/wall-clipping-collision-issue/66443)._
