Best way to handle flashlight replication?

So I just wrapped up on a local flashlight viewmodel that I made. Only thing now, is that I have to figure out the best way to go about replicating it for other clients to see.

I would love to avoid having to do the typical client-to-server, then server-to-all-clients to locally do something to render that flashlight for all other clients, because this gets insanely tricky if new clients join the game, and therefor don’t see any flashlights even when a player has it turned on. It just seems very hard to manage from that perspective.

I was wondering about possibly creating a new flashlight for that player server-sided for the other players to see, but detecting as soon as it gets inserted for the player that has the viewmodel, I’d destroy it immediately. However, I feel like that could be a bad solution as well because what if they see the flashlight for a split second before it’s destroyed?

Not too sure on the ideal route to go here. Definitely want to keep it as simple and as manageable as possible.

Thanks for any input :slight_smile:

I would go for collection services on the flashlight model (or tool) and attributes for their automatic replication towards the client when changed from the server and go from there.

1 Like