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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

make client control object when using (NetworkServer.spawn) ?

Discussion in 'Multiplayer' started by m-y, Mar 26, 2018.

  1. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470
    Hello
    i am using
    networkserver.spawn to spawn a main character for every player in the game
    the problem simply i want to tag every player first
    to be able to make the client able to control their character in the game
    Actually it is work perfect on the server side but not in the client side
    and that is my code 2.png
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Why aren't you just using the Player object that the network manager already spawns for each client?

    What isn't working on the client? I can't tell what code here you're trying to run on the server and what on the client, so it looks like you're trying to run this on both. You can only call NetworkServer.Spawn from the server though.
     
  3. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    470