Jump to content

Dynamic Tilemap Collisions Broken


Recommended Posts

        this.map = this.make.tilemap({ key: 'map'})
        let tileset = this.map.addTilesetImage('tiles', 'tiles')
        let terrain = this.map.createDynamicLayer('terrain', tileset).setCollisionByExclusion([])
        this.playerSprite = this.physics.add.sprite(200,0,'players',0)
        this.physics.add.collider(this.playerSprite, terrain)

This code has the effect of the player sprite falling through the terrain layer.


I've tried using setCollisionByProperty, setCollisionBetween, and setCollision. Nothing works. Using Phaser 3.22.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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