Pupolajshu Posted December 18, 2016 Share Posted December 18, 2016 Hello, it is me again. I have a tileset(16x16 each square) I made a tiled map with it and exported as .json After importing it into Phaser game it works fine, collision works... But when I scale the layer by two, the collision is not working(Debugging the layer shows tile body) Please help me! Also, I am not sure how the values should be in - map.setCollisionBetween(n,m); The code for that: //This goes into create function map = this.game.add.tilemap('map'); map.addTilesetImage('tiles'); map.setCollisionBetween(1, 400); layer = map.createLayer('normal'); layer.scale.set(2); layer.resizeWorld(); this.sprite = myGame.game.add.sprite(200,400,"player"); this.sprite.smoothed=false; this.sprite.scale.setTo(2); this.game.physics.enable(this.sprite); this.game.physics.arcade.gravity.y = 200; //This goes into update function this.game.physics.arcade.collide(this.sprite, layer); Link to comment Share on other sites More sharing options...
lego_brick Posted March 26, 2017 Share Posted March 26, 2017 Hi, I have the same problem. Did you manage to solve it? Link to comment Share on other sites More sharing options...
Recommended Posts