Hi guys, I just have a quick question regarding how can I make it so that my player (the one who has the authority) see something while others don’t and vise versa.
For example what I’m trying to do is hide all other players except myself. But I’m not sure how I can even start.
You can use is_multiplayer_authority() to get if the node is currently the authority, that true/false value can be applied to many things. Here’s a sample from my own network multiplayer game.
You can condition your camera’s cull masks by node on authority, and set those other player nodes to the appropriate cull mask and visual instance 3D masks so that their cameras can see the objects and the node on authority cannot or vise versa.
I just made it so that I loop over all the meshes inside the skeleton and set their layers to 2 in my case, and the camera cull mask to 2 as well on authority only which worked
Here is a sample code if anyone needs it
camera.cull_mask = 2
for mesh in meshes.get_children():
if mesh is MeshInstance3D:
mesh.layers = 2