Alright, I’ve spent a few hours on this one and could use some help…
I’ve gone off of the War Battles tutorial and made a simple 2-D game where a sprite walks around a level. Right now, the sprite walks through any of the layer 2 objects in the tilemap, however, and there’s no collision detection.
I’ve gone through this manual: Physics in Defold and set everything up correctly, as far as I can tell. Both the player and the tilesource have collision objects associated with them that should be masking each other. I’ve put a few screenshots of the windows below.
Ok, the shapes are there. And you’re not getting anything at all when moving the player on top of the trees? You’re welcome to share the project with me (bjorn.ritzl@king.com) and I’ll take a look.
I’m able to move him around when changing the collision type for the player collision object to dynamic, so I’m suspecting that the issue has something to do with the way the game is handling him moving as a dynamic collision object.
However, you’re right! Changing the collision type to kinematic, then dropping in a quick function to handle collisions seems to have fixed the issue. Thank you much!
EDIT: The collision seems to work, but the sprite seems to get “stuck” after running into one of the collision-marked tiles…
Kinematic collision objects = You control the movement of the game object and get all collision messages so that you can resolve collisions yourself
Dynamic collision objects = The physics system handles movement and collision resolution. You still get collision messages though. You can manipulate the object my applying force to it.