# \[SOLVED\] Photon Multiplayer Very Laggy!

**URL:** <https://forum.playcanvas.com/t/solved-photon-multiplayer-very-laggy/38304>\
**Category:** Help & Support\
**Tags:** scripting, graphics, learning, multiplayer, performance\
**Created:** [November 19, 2024, 6:05pm UTC](https://forum.playcanvas.com/t/solved-photon-multiplayer-very-laggy/38304 "2024-11-19T18:05:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Albertos](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/albertos/32/19749_2.png) [@Albertos](https://forum.playcanvas.com/u/Albertos)\
**Post date:** [November 19, 2024, 10:34pm UTC](https://forum.playcanvas.com/t/solved-photon-multiplayer-very-laggy/38304/4 "2024-11-19T22:34:45Z")

</div>

> [@VisionsKlips](#):
>
> it only updates the player’s or other player’s position after the keys are not being pressed instead of while being pressed

It seems like you currently have it coded that way.

![image](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/9/6/9645379bc15c9a285ee051c1996de60ee41077b3.png)

The `pos` variable of your statement is only a zero vector 3 when there is no input of the keys. When you press a key you create a vector 3 to move the player in a certain direction.

Maybe you can try the code below.

```javascript
if (!pos.equals(new pc.Vec3(0, 0, 0))) {
    this.entity.translate(pos);

    const { x, y, z } = this.entity.getPosition();
    this.app.fire("loadbalancing:sendPlayerPosition", { x, y, z });
}

```

---

_[View the full topic](https://forum.playcanvas.com/t/solved-photon-multiplayer-very-laggy/38304)._
