# Lag in DOM sprite position updates?

**URL:** <https://phaser.discourse.group/t/lag-in-dom-sprite-position-updates/7982>\
**Category:** Phaser 3\
**Created:** [October 29, 2020, 10:51am UTC](https://phaser.discourse.group/t/lag-in-dom-sprite-position-updates/7982 "2020-10-29T10:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kittykatattack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/kittykatattack/32/3888_2.png) [@kittykatattack](https://phaser.discourse.group/u/kittykatattack)\
**Post date:** [October 29, 2020, 10:51am UTC](https://phaser.discourse.group/t/lag-in-dom-sprite-position-updates/7982/1 "2020-10-29T10:51:13Z")

</div>

Hi Everyone!

I’m using a DOM object in my game as a clickable button that appears above the player character’s head. The button can follow the player around, so I’ve set the position of the button to the player’s position in the scene’s `update` method.

It works fine, but I’ve noticed there’s a slight lag in the update - the DOM button seems to be a bit behind the player’s position by a few frames.

![Screen Recording 2020-10-29 at 10.44.40](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/2/2ee3c08d545e1f9fc02a7374bd6948e44e144081.gif)

> **[Screen Recording 2020 10 29 at 10 44 40 — Postimages](https://postimg.cc/5Hd5G761)**

Does anyone have any idea why this might be happening?

---

<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:** [October 29, 2020, 3:37pm UTC](https://phaser.discourse.group/t/lag-in-dom-sprite-position-updates/7982/2 "2020-10-29T15:37:59Z")

</div>

If you’re using Arcade Physics, you should follow the physics body.

---

<div class="post-metadata">

**Author:** ![kittykatattack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/kittykatattack/32/3888_2.png) [@kittykatattack](https://phaser.discourse.group/u/kittykatattack)\
**Post date:** [October 30, 2020, 8:55am UTC](https://phaser.discourse.group/t/lag-in-dom-sprite-position-updates/7982/3 "2020-10-30T08:55:16Z")

</div>

Thanks @samme, That was it!!

For some reason I thought that `sprite.x` was an alias for `sprite.body.position.x`. This explains a lot, glad I’ve got that nuance sorted out now 🙂
