How to make certain object visible to server and not in client?

Hello so im making a gun that basically has a beam coming out of it. I kind of did the beam for both client and server. Is there any way i could hide the server beam from the client?

1 Like

There is a weird niche mechanic that if on server you parent objects inside a Camera, then those don’t get shown to clients.

Let me know if that works! :smiley:

1 Like

You can change the weapons transparency on the client side if you wish as this will only affects clients!

make it not transparent on the server

and then using a Script with RunContext set to Client, make it transparent on the client

something like that

Bad idea for game optimization.


Rather than having the server calulate something unessecary, you should just have only the client speak for that effect. Client sided effects also gives you more control over them, allowing you to better change how they look, it also allows for better optimization if you make some kind of settings for the game to remove specific details.

The server should only be used for important assets rather than effects of a weapon, such as calulating physics (or if you want the player to manage physics), or raycasts.


That just changes how the script runs, setting it to Client effectively makes the script a LocalScript, and would only apply local changes on the Client.

The Camera’s parent is the Workspace, which is what is rendering the objects, I think you mean Lighting.

I mean exactly what I said :smiley: You can try this setup yourself in studio:
On Server:
kuva
kuva
What client sees:
kuva
kuva

That wouldn’t work then, because:

  1. It does not replicate it, therefore it cannot be used for later.

  2. Beams require a Parent, which is a BasePart

  3. The Beam is parented to the Weapon.

Either way, if none of the clients are going to see it, and server isnt going to do anything with it. there isn’t a point in having it, unless the OP is debugging something, which can still be done on both Client and Server if they wanted to, so its just an unessecary item on the server, and not worth doing.

Isn’t that precisely what OP wanted? Beam to exist on server but not on client? :smiley: It all comes down to context, which we don’t have much of. Is the beam a “part beam” or is it an actual Beam instance and so on

I guess i didnt make much of a sense. What i wanted to achieve is to eliminate a delay in my beam so my original solution was to make the beam on the server but it has a delay on the client it lags behind on the client’s POV. So i thought i could just make two beams, one that appears for the client and one for the other players to see. I guess it wasnt efficient as @DasKairo said. anyway heres what my problem looks i that was the only solution i could think of.

Edit: Also thanks for the suggestion i’ll definitely try them out soon, after my exams since i cant focus much on coding right now it was just bothering me so much i couldnt focus on studying