[SOLVED] Photon Multiplayer Very Laggy!

It seems like you currently have it coded that way.

image

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.

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 });
}
1 Like