# Drag and show

**URL:** <https://phaser.discourse.group/t/drag-and-show/9360>\
**Category:** Phaser 3\
**Created:** [April 21, 2021, 8:07am UTC](https://phaser.discourse.group/t/drag-and-show/9360 "2021-04-21T08:07:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camouflaged\_penguin](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@camouflaged\_penguin](https://phaser.discourse.group/u/camouflaged_penguin)\
**Post date:** [April 21, 2021, 8:07am UTC](https://phaser.discourse.group/t/drag-and-show/9360/1 "2021-04-21T08:07:25Z")

</div>

Hi there. i try to use Drag for my movement controll but i am not sure how to get it right. I don’t want to add a variable but instead use the object “basket” to be clicked and dragged.

```
  this.basket = this.add.image(200, 250, 'basket').setInteractive();
  this.basket.scaleX=.5;
  this.basket.scaleY=.5;

  this.input.setDraggable('basket');

  // The pointer has to move 16 pixels before it's considered as a drag
  this.input.dragDistanceThreshold = 16;

  this.input.on('dragstart', function (pointer, gameObject) {

     gameObject.setTint(0xff0000);

 });

  this.input.on('drag', function (pointer, gameObject, dragX, dragY) {

     gameObject.x = dragX;
    // gameObject.y = dragY;

 });

  this.input.on('dragend', function (pointer, gameObject) {

     gameObject.clearTint();

 });
```
