Search Unity

How can I make one player invisible?

Discussion in 'Multiplayer' started by jasonwu700, Jan 1, 2023.

  1. jasonwu700

    jasonwu700

    Joined:
    Nov 13, 2022
    Posts:
    5
    How do I make one player invisible to other cameras, but it is still visible to that player's camera?
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
  3. jasonwu700

    jasonwu700

    Joined:
    Nov 13, 2022
    Posts:
    5
    I want to make an ability for each player to be invisible to all other cameras other than themself, so do I have to add a layer for each player? That does not sound very efficient.
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
  5. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    If each player is running on their own client, then just have visible layer and invisible layer, and the local pawn is the only one on the visible layer.

    If you have split screen for multiple players on the same client, then you just expand this to say up to four visible layers (up to four local players on a single client) and a single invisible layer for all other pawns.

    If you don't support split screen (two or more local players on a single client), you could just remove the mesh from those pawns that are not local. That would be my first approach.