Unable to synchronize the movement of two players

Godot Version

4.3.1

Question

I am using two windows to present the player's view on left -120~0 degrees and right 0~120 degrees FOV. There's only one player actually, but I have no better idea than using two window-player-camera structures to make this, as are shown in the snapshot below. Two player nodes in different windows have same settings and share the same script. ![截屏2025-04-03 11.13.56|304x500](upload://7UlwOgNpFBev13vHkd3F1ka0uUI.png) The problem is, I am using serial port to control the movement of the player. Now only one window show moving player, while the other is static. I think that's because only the player in one window is connected to the serial port, while the other cannot. I want to bypass the serial port to solve this, simply by having one player node connected to another player node and receiving movement state, but I don't know how to do this. Many thanks if you can help me with this problem.

When you say two windows do you mean two processes? Or two subviewports?

If its two processes I dont know if its possible. When a window/process losses focus in Windows it losses input notifications. You can test this if you select the window you want to control and provide input.

If its viewports, input trickles down on the viewport similarly when it has gui focus. You probably need to decide in the main viewport where the inputs should go, or duplicate the inputs if necessary.

See input tutorial

And see viewport.push_input() function

1 Like