Tiledmap and physic object doesnt collide (SOLVED)

Hi
I am learning defold and I loved it, it is an interesting tool :slight_smile:

My problem is about collisions. I enabled physic debug.

This is my player called kare. This is collision object.

This is my main.collection:

Tilesource

In the player,(debug enabled) you can see player colliders but in tiled map, nothing differnt.

My player(collision objects) drops and does not collide anything scene.

What is the wrong I did?

So, from the first screenshot it doesn’t look like you’ve configured the collision group and mask properly. The kare game object has both group and mask set to default. And what about the game object containing the tilemap ? Have you added a collision object with the tilemap as shape and configured it’s group and mask?

Here is the related image:

My tilemap is in “go” gameobject.

I tried to set mask and group values to “go” and nothing changed.

What should I do another? @britzl

1 Like

Did you set the group both of the tilemap and the other object?

Try setting the mask and group of the kare.go object’s collider to ‘go’ - unless both the tilemap and the other object have the mask of each other’s group, no collision will happen.

1 Like

As Lukas said, you need to have the group name of one as the mask of the other and vice versa. I wrote some more about fixing collision object issues here: Collecting objects (SOLVED)

1 Like

@Lukas_Palmer, @britzl thanks for answers I will try these

But what I dont understand is why dont seem colliders of tiledmap in debug mode?

1 Like

Have you done this? Your game object holding the tilemap also needs a collision object with the shape set to the tilemap itself. Like this:

2 Likes

I solve the question by looking into defold platformer project.

I learned that positions, groups and masks very important in defold. Also I realised that physic type should be static for the platforms.

Thanks for replies and your patient :slight_smile:

2 Likes

Excellent! I’m happy to hear that you solved the problem.

1 Like