how to update the position of the image?

I make an asynchronous get request and get the coordinates of the image, how to constantly update them without calling the create() function in update()

create(){
drone1 = this.add.sprite(blue_player_x[0],blue_player_y[0], ‘drone1’)
drone1.rotation = blue_player_r[0];
}
update(){
xhr.open(
‘GET’,
http://127.0.0.1:31222/user?user=all’,
true
)
xhr.send()
xhr.onreadystatechange()
this.create()
}

calling drone 1.x = blue_player_x[0]; drone 1.y = blue_player_y[0]; instead of this.create(), does not work, everything is on the same place and as if the coordinates do not even change

Are there any errors in the browser developer console? Updating the x property on the game object should work in the update method.

In your code, are you waiting until the xhr request is complete before attempting to update the game object positioning?