Why does pressing W move every player?

The one line every s&box multiplayer component needs.

Why does pressing W move every player?

The problem

Your input moves everyone.

protected override void OnUpdate(){    var move = Input.AnalogMove;    WorldPosition += move * Speed * Time.Delta;}

Every player's copy of this component runs on your machine, and every one reads your keyboard.

Why it happens

Everyone runs everyone's code.

In a 4-player game, each machine has all 4 players, and runs OnUpdate on all of them.

Your player
you control it
The other 3
proxies: someone else controls them

The fix

If it's not yours, stop.

protected override void OnUpdate(){    if ( IsProxy ) return;     var move = Input.AnalogMove;    WorldPosition += move * Speed * Time.Delta;}

IsProxy is true when another player controls this object. Return early and only your player reads input.

Where it goes

Guard anything that's 'mine'.

Put the check in front of anything only the owner should do.

Reading input
if ( IsProxy ) return;
Moving the camera
if ( IsProxy ) return;
Drawing the model
everyone, no check

The rule

Not yours? Return.

Owner only
if ( IsProxy ) return;
Proxies
someone else's player
Visuals
run for everyone