79450772

Date: 2025-02-19 09:20:17
Score: 0.5
Natty:
Report link

Sounds less than a Mirror related problem that just scripting. You could use a dual camera setup for each player, like FPSs usually do to draw weapons on the screen independently of environment geometry (so that the model doesn't clip through meshes if you get close to a wall).

You make two cameras, with the exact same behavior, except that one has its culling mask set to render objects on the current player's client layer (which you have to set in projects props), and the other renders everything except the client layer.

When you pick up an object, you just have to change the layer on which the gameobject and its children are on: you put them on all on the client mask. This way, other player's cameras are simply not rendering it.

This has the downside that, for each players, there has to be an available layer for its Client camera's culling mask to set on (and for the others to exclude). So if your game is 8 players, there has to be 8 layers. It makes this solution rather inelegant, because you rely on the editor max layer count, but except if you plan on making your game playable by more player than you can declare layers on, which shouldn't be the case, then you're good.

To summarize:

The result is:

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: RayureBob