Player getting stuck behind code-generated tiles

Miguell

  • Posts: 1
Hello, I have a problem where my player character, when running across a straight row of tiles created by the code I have written, get's stuck behind "invisible walls" at the edges of the tiles. This also happen when sliding off a column of code-generated tiles.
This does not happen with tiles I have put into the scene in the scene-editor.  I assume this is because the scene automatically gives a single collision box for the pre-arranged tiles, but the code-generated ones have imperfect collision boxes, leading to the player getting stuck?
I have tried dozens of solutions, none of them have worked. Is there a solution to this at all or do I need to move onto another platform?

Luyren

  • *
  • Posts: 2682
Hello, I have a problem where my player character, when running across a straight row of tiles created by the code I have written, get's stuck behind "invisible walls" at the edges of the tiles. This also happen when sliding off a column of code-generated tiles.
This does not happen with tiles I have put into the scene in the scene-editor.  I assume this is because the scene automatically gives a single collision box for the pre-arranged tiles, but the code-generated ones have imperfect collision boxes, leading to the player getting stuck?
I have tried dozens of solutions, none of them have worked. Is there a solution to this at all or do I need to move onto another platform?
Tiles placed at runtime are not combined like tiles placed in the scene designer. You can try rounding the corners of your actor's collision boxes.

Alternatively, my Player Control behavior has support for semi-solid platforms that can be chained together, so that's a possible solution, you'd just use actors instead of tiles when you create your terrain through code. You can get it in this link, and there is a video tutorial in this same page: https://luyren.itch.io/luyrens-miscellaneous-stencyl-behaviors
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter