Hello guys. I’m creating a multiplayer FPS game using Colyseus. I’m simulating other players opening several tabs in the browser. As soon as I open a new browser tab, the server generates a random position on the map for that client and searches for the positions of other players in the room. So far everything is working fine, but whenever I pass the position where an enemy player was created, the current client “teleport” that enemy player to that position again.
Example:
Player A was created at position (3, 1, 3).
Player B was created in position (6, 1, 6) and then moved to position (9, 1, 9).
When player A (current customer) passes through position (6, 1, 6) player B instantly appears in that position.
This “teleport” only happens on the current client side (player A), so player B remains in the correct position (9, 1, 9) because he doesn’t hear movement.
Note: When I disable the rigidbody of the cloned entity to reproduce enemy players this problem disappears.
Can anyone point me to a way to solve this problem?
Client side project
https://playcanvas.com/project/1027145/overview/colyseus
Server side project it is identical to the tutorial with only one change in floor size to 24
https://developer.playcanvas.com/en/tutorials/real-time-multiplayer-colyseus/