Just need help to make my shit not sync but still work for multiplayer with health slider

It seems when the Host takes damage all Clients also take damage and the sliders are all wacked

// paste your code here

I’m new to network stuff and Unity in general, heres just a video showing it:

https://uploads.overwolf.com/owclient/direct/2024/04/07/69a19918-6065-456e-8d01-7ad07b43cfc6.mp4

How can I fix this?

I’m not familiar with Netcode (I have only used Photon), but I may understand the nature of your problem.

It looks to me through your example video that you are not disabling the respective host/client player that is not yours. IE, you spawn in two player prefabs and when you press space, both players are receiving damage because both scripts are active. You could confirm this by checking each player object in the editor at runtime.

If that is the problem, I’m seeing that you can check for local authority in Netcode with IsLocalPlayer.

Maybe your player health script would look something like this?

void Start()
{
     currentHealth = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
     if(!IsLocalPlayer)
     {
          this.enabled = false;
     }
}