# Arcade body teleports back when pushing against a corner

**URL:** <https://phaser.discourse.group/t/arcade-body-teleports-back-when-pushing-against-a-corner/2184>\
**Category:** Phaser 3\
**Created:** [April 21, 2019, 10:46am UTC](https://phaser.discourse.group/t/arcade-body-teleports-back-when-pushing-against-a-corner/2184 "2019-04-21T10:46:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drusin](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/drusin/32/1281_2.png) [@drusin](https://phaser.discourse.group/u/drusin)\
**Post date:** [April 21, 2019, 10:46am UTC](https://phaser.discourse.group/t/arcade-body-teleports-back-when-pushing-against-a-corner/2184/1 "2019-04-21T10:46:29Z")

</div>

Hi there,  
I’m a first time Phaser user and to get accuainted with it I’m currently porting a small bomberman clone from libGDX to Phaser 3. I have run into a strage physics behaviour and did not find anything about it online:

When my player diagonally walks into a tilemap wall, it gets teleported back as soon as it reaches the corner [see this gif](https://i.imgur.com/e61d5v0.gif).

Some code snippets:

```
const config = {
	type: Phaser.AUTO,
	pixelArt: true,
	scale: {
		parent: 'xplosive',
		mode: Phaser.Scale.FIT,
		width: 64,
		height: 64,
		max: {
			width: 640,
			height: 640
		}
	},
	backgroundColor: '#cccccc',
	scene: { 
		preload,
		create,
		update },
	physics: {
		default: 'arcade',
		arcade: { debug: true }
	}
};

new Phaser.Game(config);

```

##############################

```
const map = this.make.tilemap({ key: 'map' });
const tileset = map.addTilesetImage('brick-sheet', 'tiles');
const undestructibleLayer = map.createStaticLayer('undestructible', tileset, 0, 0);
undestructibleLayer.setCollisionByProperty({ collision: true });

const player = this.physics.add.sprite(4, 4, 'blue');
player.setSize(6, 6, true);
player.setCollideWorldBounds(true);
player.depth = 10;
this.physics.add.collider(player, undestructibleLayer);

const cursors = this.input.keyboard.createCursorKeys();

```

##########################################################

```
if (!(left || right)) {
    body.setVelocityX(0);
}
else {
    body.setVelocityX(left ? -SPEED : SPEED);
}

if (!(up || down)) {
    body.setVelocityY(0);
}
else {
    body.setVelocityY(up ? -SPEED : SPEED);
}

```

I like the ECS pattern, so there is an engine and some systems inbetween but the movement code ist pretty simple.

[You can try it out here](https://drusin.github.io/xplosive-phaser/)  
[Or browse through the repo here](https://github.com/drusin/xplosive-phaser)

Any idea what I might be doing wrong?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [April 21, 2019, 5:02pm UTC](https://phaser.discourse.group/t/arcade-body-teleports-back-when-pushing-against-a-corner/2184/2 "2019-04-21T17:02:16Z")

</div>

Try decreasing [this.physics.world.TILE\_BIAS](https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.World.html), e.g. to 8 or 4.

---

<div class="post-metadata">

**Author:** ![drusin](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/drusin/32/1281_2.png) [@drusin](https://phaser.discourse.group/u/drusin)\
**Post date:** [April 21, 2019, 9:00pm UTC](https://phaser.discourse.group/t/arcade-body-teleports-back-when-pushing-against-a-corner/2184/3 "2019-04-21T21:00:28Z")

</div>

Setting the TILE\_BIAS to the tile size (8 in my case) worked like a charm, thanks a lot!
