# Best way to move player sprite

**URL:** <https://phaser.discourse.group/t/best-way-to-move-player-sprite/8166>\
**Category:** Phaser 3\
**Created:** [November 20, 2020, 5:10am UTC](https://phaser.discourse.group/t/best-way-to-move-player-sprite/8166 "2020-11-20T05:10:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eliaquim](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/eliaquim/32/4364_2.png) [@Eliaquim](https://phaser.discourse.group/u/Eliaquim)\
**Post date:** [November 20, 2020, 5:10am UTC](https://phaser.discourse.group/t/best-way-to-move-player-sprite/8166/1 "2020-11-20T05:10:41Z")

</div>

Hi there!  
I’m using a physics arcade.  
I’m having some doubt about how to move the player.  
I already tried of these 3 methods on the update function:

```
        player.body.y += 1;
        player.y += 1;
        player.setVelocity(0, 48);

```

With the first two ones I notice that when the sprite touches a screen edge, it still moves a little bit out of it.  
But with the setVelocity, the sprite doesn’t do that.  
How should I use and what is the difference between them?

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [November 20, 2020, 7:20am UTC](https://phaser.discourse.group/t/best-way-to-move-player-sprite/8166/2 "2020-11-20T07:20:27Z")

</div>

Hi,  
Try player.body.setVelocity(0, 48), if you modify the body.y directly the collisions wouldn’t work

---

<div class="post-metadata">

**Author:** ![Eliaquim](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/eliaquim/32/4364_2.png) [@Eliaquim](https://phaser.discourse.group/u/Eliaquim)\
**Post date:** [November 21, 2020, 10:26pm UTC](https://phaser.discourse.group/t/best-way-to-move-player-sprite/8166/3 "2020-11-21T22:26:58Z")

</div>

Hi!  
Thanks for the info! Didn’t know the collision thing.  
Yes, I have changed:

this.player.setVelocity

to

this.player.body.setVelocity.

Thank you!
