No message on collision_response (SOLVED)

Hello !

I created two type of GO, one for the map and one for the hero.

The hero has a collision box of the kinematic type. Its group is players and its mask is world.

The map has a collision shape set to static in the tilemap. Its group is world and its mask is players.

Whenever I cross the wall I do not receive any “collision_response” message.

Can you please explain why this is happening ?

Thanks a lot for your help !

I uploaded the game for more info.

FarmTown.zip (880.7 KB)

1 Like

I’m unable to check your code. Maybe you can compare with this minimal example to spot the problem with your code:

1 Like

Maybe I am missing something, but i did exactly what you did.

You have problems with tiles and collisions

– In Tile Source, you should name your Collision Group to “world”

– Your collision tiles are not selected. You should select them by clicking on tiles in Tile Source

– You tile map and your hero sprite are not positioned correctly.
You can see the physic debug by using:

msg.post("@system:", "toggle_physics_debug")

Instead of changing sprite and tilemap positions, change the GO positions.

Here is the fixed version:
FarmTown.zip (724.1 KB)

Also I have suggestions for you:

– If you are going to use pixel art than set Textures Min&Mag Filters to "nearest on game.project

– Use a camera and it is zoom

3 Likes

Nope. I checked your project:

Your her looks good. It has a kinematic collision object with group players and mask world:

Your tilemap component has a collision object that is static with mask players:

Now, let’s take a look at the tilesource used by the tilemap. There’s two problems here: 1) You have not assigned any collision groups to the tiles in your tilesource. The default group is there but I would have expected the world group to exist and your wall tiles “painted” with that group. 2) You use a different collision image. It can be useful under certain circumstances, but in this case I believe it signals that you have misunderstood how collisions work for tilemaps.

What you should do is create a world collision group in your tilesource, select the world group and “paint”/select all tiles that should belong to that group. You should also change collision image to the same as the one used by the tilesource. This is described in the tilesource manual.

4 Likes

Thanks a lot !

That was very helpful and everything is solved.

Great answers !