How to make object invisible to a specific camera

I’m trying to make a multiplayer game. I have one player prefab with renderer and camera. I need each camera to ignore self mesh and render other players. How can I achieve that without creating a layer for every single player?

Layers was my 1st answer, and probably the best way of doing it. Dont know what your using for a controller, but 1st person controllers can do that. Also possible with 3rd person controller with offsets and a few tweaks.

If you wont use layers, start looking toward your controller, only option i can think of. Best of luck :slight_smile:

You could use Unity - Scripting API: MonoBehaviour.OnPreRender() and where you disable the renderer only when it’s time to render a specific camera whose InstanceID is the same as the one on the same prefab and reenable it OnPostRender.

1 Like