Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Client need position from all other clients

Discussion in 'Netcode for GameObjects' started by TruckerJoe, Jul 27, 2023.

  1. TruckerJoe

    TruckerJoe

    Joined:
    Feb 25, 2019
    Posts:
    39
    Hi,

    I am making a minimap in my game right now, without a topdown camera.
    And the player should see the other team mates in the minimap, like in counter strike.
    So the player needs every position of every other client every update loop.
    Can anyone give me a tip what is the best and network friendly solution for this?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,117
    The other players are already synchronized, otherwise a player wouldn't be able to see them move around, right? ;)

    That means there is no extra networking involved here. Just get all the other player instances (*) and draw blips for them on the minimap.

    * = many ways to go about this, just a few: get them by tag, get a specific component in children, or have them register locally to a list whenever one spawns or despawns
     
    TruckerJoe likes this.
  3. TruckerJoe

    TruckerJoe

    Joined:
    Feb 25, 2019
    Posts:
    39