Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

text above the player with his name

Discussion in 'Multiplayer' started by NikoBusiness, Oct 17, 2014.

  1. NikoBusiness

    NikoBusiness

    Joined:
    May 6, 2013
    Posts:
    289
    hey guys i want to make a script that will show text above players with their names. its very easy for single player but for multiplayer it made MY HEAD BLOW UP! i tried some concepts that i thought but i ended up on a deadlock! so please someone help me
     
  2. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,116
    Each player should send his name after connection to server by an rpc and server would broadcast it too all others.
    then for each player object just have a simple GUI like single player which shows the name.
    The trick is on synchronizing the value of each name for everyone.
    in client you send to RPCMode.Server and from server to RPCMode.others and that's it.