Jump to content

Friction on TilemapLayer with Arcade Physics


justGoscha
 Share

Recommended Posts

Hey everyone,

 

I created a tilemap layer and enabled Arcade physics for it and set the friction to 1,0. I also set up collisions and everything. But when my bullets collide with the map, there is no friction applied, they just slide through.

Is the friction property supposed to work with Arcade physics at all, because I've only seen topics of friction with the P2 physics. So I'm not sure.

...var map : Phaser.Tilemap = game.add.tilemap('map');map.addTilesetImage('ground_1x1');map.setCollisionBetween(1,12);this.layer = map.createLayer('Tile Layer 1');this.layer.resizeWorld();			game.physics.startSystem(Phaser.Physics.ARCADE);game.physics.arcade.enable(this.layer);this.layer.body.friction.setTo(1,0);...
this.bulletGroup = game.add.group();this.bulletGroup.enableBody = true;this.bulletGroup.physicsBodyType = Phaser.Physics.ARCADE;this.bulletGroup.createMultiple(500,'bullet');this.bulletGroup.setAll("anchor.x", 0.5);this.bulletGroup.setAll("anchor.y", 0.5);this.bulletGroup.setAll('outOfBoundsKill', true);this.bulletGroup.setAll('checkWorldBounds', true);this.bulletGroup.setAll('body.mass',0.1);...game.physics.arcade.collide(this.bulletGroup, this.layer, this.bulletCollision);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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