# Having problem with Tilemap collision

**URL:** <https://forum.defold.com/t/having-problem-with-tilemap-collision/83208>\
**Category:** Questions\
**Created:** [September 7, 2026, 11:31am UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208 "2026-09-07T11:31:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolley2112](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/wolley2112/32/40672_2.png) [@Wolley2112](https://forum.defold.com/u/Wolley2112)\
**Post date:** [September 7, 2026, 11:31am UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/1 "2026-09-07T11:31:01Z")

</div>

Sorry if my english was bad.

So, im making a platformer game, and im using tilemap to create levels.

And for some reason, the player object is colliding with a surface that has a normal vector (1,0,0) or (-1,0,0),even when the player is on floor and theres no

And the same problem for the wall, when the player is colliding with the wall, it collide with a surface that are like floor,even when theres no floor.

I’ve found some way to make the player able to move on the floor, but they still climbing on the wall like some spiders.

I’ve tried to take the script from the Platformer sample and put it in my project, but it doesnt work.

Plz help me:\<

---

<div class="post-metadata">

**Author:** ![Asatte](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/asatte/32/39093_2.png) [@Asatte](https://forum.defold.com/u/Asatte)\
**Post date:** [September 7, 2026, 11:42am UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/2 "2026-09-07T11:42:36Z")

</div>

Hi, could you attach the code you are using with player movement, maybe some screenshots of player on debug mode (for physics) or a video?

---

<div class="post-metadata">

**Author:** ![Wolley2112](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/wolley2112/32/40672_2.png) [@Wolley2112](https://forum.defold.com/u/Wolley2112)\
**Post date:** [September 7, 2026, 12:27pm UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/3 "2026-09-07T12:27:23Z")

</div>

sure, here is my script

[redbot.script](https://forum.defold.com/uploads/short-url/11int7zuOJtzBfXU1b2jpGwXnH1.script) (4.4 KB)

---

<div class="post-metadata">

**Author:** ![Wolley2112](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/wolley2112/32/40672_2.png) [@Wolley2112](https://forum.defold.com/u/Wolley2112)\
**Post date:** [September 7, 2026, 12:33pm UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/4 "2026-09-07T12:33:39Z")

</div>

Aaaand some video

> **[20260907\_192540.mp4](https://drive.google.com/file/d/1naVcdq-ZE3VS5UPAXt1GJiAV2h4F3eVh/view?usp=drivesdk)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![Wolley2112](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/wolley2112/32/40672_2.png) [@Wolley2112](https://forum.defold.com/u/Wolley2112)\
**Post date:** [September 7, 2026, 12:34pm UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/5 "2026-09-07T12:34:12Z")

</div>

Hope those two would help you

---

<div class="post-metadata">

**Author:** ![Andrew\_Fowler](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/andrew_fowler/32/43431_2.png) [@Andrew\_Fowler](https://forum.defold.com/u/Andrew_Fowler)\
**Post date:** [September 8, 2026, 1:42pm UTC](https://forum.defold.com/t/having-problem-with-tilemap-collision/83208/6 "2026-09-08T13:42:59Z")

</div>

I think you’re dealing with ghost collisions. see [Struggling with kinematic physics ghosting collisions and jittering - Questions - Defold game engine forum](https://forum.defold.com/t/struggling-with-kinematic-physics-ghosting-collisions-and-jittering/81951) —this video shows it working better.

This happens when a sprite moves across tile boundaries because the tile collision objects aren’t one continuous shape but are instead made up of small, tile-sized pieces. As the sprite moves over these boundaries, it catches on them.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/0/2/024a0c3fe1962a26285f023a2965678dda215daa.png)

The way I’ve handled this before is by checking the position of the collision. For example, if your tile grid starts at position 0,0 and the tiles are 32x32, ghost collisions will usually occur near each multiple of 32. If the collision’s x or y is close to that, I send out a raycast to double-check its status (based on the normal) and then decide whether to discard or use it.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/1/b/1bf94ba531e03013a002fff53ccdc49013b227eb.png)

So if detecting a collision on the right and its very close to the tile boundary, send a ray cast a little higher up. if this fails to collide with anything you know its a ghost and can ignore it.

Another option is to skip contact point collisions entirely and create a custom collision system for the main sprite using raycasts. If this is of interest, look at [britzl/platypus: Defold platformer engine](https://github.com/britzl/platypus).

For my platform game, I started with contact point collision, added measures to prevent ghost collisions, but eventually—much later in development—switched to a custom raycast approach for the main sprite. Britzl’s method for handling moving platforms proved extremely useful in my implementation.
