player movement gets stuck on platforms made of tiles

I have platforms made of tiles in a single row and often the player will get stuck and is only able to move beyond some point without a running start.  The player seems to get stuck at the location where two tiles meet.

I ran into this issue while working on my own platformer game, but I also see this occurring in the Platformer - Basic PHYSICS 0v980 example.  To repro, tap left until your player comes to a stop and then press right until your player stops and repeat until you get stuck in the middle of the tile.  Let me know if you need a video of this, but it should be easy to reproduce.  

Is there a one pixel space that is catching the corner of the player shape?

Thanks as always!

Hey Adam

I rmember looking into this before when prototyping a platformer…(which I never finished) But I believe its a very common problem when assigning individual physics bodies to each tile… as you suggest, the top corner points dont necessarily line up exactly… so a player with a flat bottomed physics body can get its corner caught on the join… One solution is to create hidden collision objects that span larger sections of the terrain. Another is to bevel/round the corners of the player physics body

Other might have more info on it…

Cheers

R

Rgreene_dub beat me to it. This is a common physics problem, not a bug per se. I’ve seen it often on my end. My solution has been to adjust the bounce property of the player until he stops catching on edges. Rgreene’s suggestion sounds more useful though. You could also use a circular body for the player or a multi body with a circular body at the sprite’s feet. 

Thank you, Rgreene_dub and Dyson!  great explanation and suggestions.

Hey Adam

I rmember looking into this before when prototyping a platformer…(which I never finished) But I believe its a very common problem when assigning individual physics bodies to each tile… as you suggest, the top corner points dont necessarily line up exactly… so a player with a flat bottomed physics body can get its corner caught on the join… One solution is to create hidden collision objects that span larger sections of the terrain. Another is to bevel/round the corners of the player physics body

Other might have more info on it…

Cheers

R

Rgreene_dub beat me to it. This is a common physics problem, not a bug per se. I’ve seen it often on my end. My solution has been to adjust the bounce property of the player until he stops catching on edges. Rgreene’s suggestion sounds more useful though. You could also use a circular body for the player or a multi body with a circular body at the sprite’s feet. 

Thank you, Rgreene_dub and Dyson!  great explanation and suggestions.

Hello, has anyone been able to solve this issue ? Thanks in advance.

Hey Ulydev6,  Yes, I solved this by following Rgreen_dub and Dyson’s advice and used a single object to build the floor/platforms for my game.  I wished i could have just used tiles to create the floor, but as they said, there would always be these gaps between physics objects where my player might get stuck.  

Thanks you for your answer. I also solved this problem by setting the character’s bounce property to 0.01. The player doesn’t get stuck anymore. So I kept the physic tiles system as the big objects were really disappointing (had to change the map culling, etc…). Also, thanks to Dyson’s advice I set a boolean flag hasCollidedTile to the player, so I can check whether to make him able to jump or not, as well as changing the sprite sequence.

Hello, has anyone been able to solve this issue ? Thanks in advance.

Hey Ulydev6,  Yes, I solved this by following Rgreen_dub and Dyson’s advice and used a single object to build the floor/platforms for my game.  I wished i could have just used tiles to create the floor, but as they said, there would always be these gaps between physics objects where my player might get stuck.  

Thanks you for your answer. I also solved this problem by setting the character’s bounce property to 0.01. The player doesn’t get stuck anymore. So I kept the physic tiles system as the big objects were really disappointing (had to change the map culling, etc…). Also, thanks to Dyson’s advice I set a boolean flag hasCollidedTile to the player, so I can check whether to make him able to jump or not, as well as changing the sprite sequence.