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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unet connection only to server, not to other clients

Discussion in 'Scripting' started by light766, Oct 28, 2018.

  1. light766

    light766

    Joined:
    Apr 23, 2009
    Posts:
    250
    Hello, i currently using UNET to attempt to create a secure connection to a server. The issue I currently have is when i connect to the server, i can see other players that connected to the server. I use a player object to send [Command] calls to the server.

    Not sure how secure this is, but i dont want the client to know how many players are online nor do i wish for them to see any information on the clients such as IP or any other information.

    Is there a way to disable this, except for deleting the player object if localPlayer == false or just not creating the objects as I am assuming if i just made it so that it just didnt spawn player objects, the information of other clients would be in the background of the application somewhere.
     
  2. light766

    light766

    Joined:
    Apr 23, 2009
    Posts:
    250
    Bump, still having this issue sadly, any way to limit observers to only the server & client without client information to other clients?
     
  3. dontdiedevelop

    dontdiedevelop

    Joined:
    Sep 18, 2018
    Posts:
    68
    use #SERVER pragma in your code and set this pragma in playersettings WHEN SERVER BUILDING NOT CLIENT