Search code examples
c#unity-game-enginecamerarender

PUN 2.0 Camera renders for each player


The main problem is to render a player body for every other player in a room. However, the player themself must see only attached hands, not his own body (and he must not see others attached hands). Is there a way to do this?

I tried to use a culling mask on cam, but it doesn't make a lot sense.


Solution

  • Culling mask actually make sense. Mark the body mesh with different layer should hide the body.

    You just need to enable / disable it base on isLocalPlayer value.

    Alternative way of doing this would be using two set prefebs.

    • A. One is player controlled

    • B. One for other player.

    Where prefeb A only contains hands. But note that this come with other issue like player's body will not cast shadow as it does not exist.