Jump to content

Issue with .onFloor() and tiles causing failed collision?


Recommended Posts

I've created this piece of input in my current platformer:

if(this.cursor.down.isDown || this.wasd.down.isDown){                if (this.player.body.onFloor() == false && this.slamValue == 0) {                      this.player.body.velocity.y = 1000;                      this.slamSound.play();                      this.slamValue = 1;                }            }

Which causes the player to move downward quickly. 


I was previously using this.player.touching.down on non-tilemaps but switched to using Tiled because it's easier to make levels. Unfortunately, sometimes when issuing this downward slam the player will not collide with the tiles and move through floors. Note that this does not happen every time you slam down.


Is there a known issue with this or something that I'm perhaps doing wrong?

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...