Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Only send input to presented client with Netcode PlayMode tools?

Discussion in 'NetCode for ECS' started by fajerbujt, May 25, 2020.

  1. fajerbujt

    fajerbujt

    Joined:
    Feb 29, 2020
    Posts:
    14
    I'm trying out the new NetCode package but having problems debugging using the Multiplayer PlayMode Tools. It seems that input are being sent to all clients & not just the one thats being presented (has the "Present" box ticked), making it hard to test player inputs & interactions. Is it meant to be working this way or is there something I can do to make only the presented client to receive my inputs?

    I've tried having two clients, one spawned through the editor & one spawned from a project build which worked perfectly (eg. each client responds only to input when active and each entity is updated correctly/synced)
     
  2. YuriyVotintsev

    YuriyVotintsev

    Joined:
    Jun 11, 2013
    Posts:
    91
    You can check
    World.GetExistingSystem<ClientPresentationSystemGroup> ().Enabled
    to check if this client is present now, and update input only if this system group enabled.
     
    florianhanke likes this.
  3. fajerbujt

    fajerbujt

    Joined:
    Feb 29, 2020
    Posts:
    14
    This worked perfectly thanks!