Rotation of Sprite while being clicked

Hi everyone,

I am trying to figure out a way to rotate a sprite in the direction of drag while being draged.
I am using the angleToPointer function and it works all right but only once when the sprite is clicked.
when I drag the sprite around it does not rotate. I guess I need something similar to this but for phaser 2?

     * The Drag State of the Pointer:
     *
     * 0 = Not dragging anything
     * 1 = Being checked if dragging
     * 2 = Dragging something
     *
     * @name Phaser.Input.Pointer#dragState
     * @type {number}
     * @default 0
     * @since 3.0.0
     */

this.dragState = 0;

i tried to use IsDragged but still the same. any ideas?

You have to invoke it in the update predefined method not the create one maybe you’ve invoked it there

Yes I do that, but it still just rotates once towards the pointer and stays the same for the rest. it seems the positions do not get updated which is why the angle stays the same…

I suggest you try to understand how this example works https://phaser.io/examples/v2/arcade-physics/angle-to-pointer

thnaks for your help, I checked the example already and its not quite what I would like to achive, even though its similar. I would like the sprite to rotate only while being clicked and in the direction i move the sprite, like you drag a car and it moves and turns where you drag it