IRLaser replication problem

Hallo everyone, I have a mulltiplayer VR project with the Laser and NVG. So when you enable the laser in NVG this must turn into IRLaser and has to be seen only for the user with the NVG turning on, the User without NVG can not see the IRLaser. My issue is that when I turn on the IRLaser for User 1 he sees it right but the User 2 sees the normal laser.

(The NVG is turned on by clicking the button in UI and this also enables the funktion with IRLaser.)

What can I do to fix this issue ?

Thanks for attention

That’s because you’re calling a local function (SetUseIRLaser) which changes the laser to it’s IR look on the owning client, no one else is receiving this function call so they won’t see it. I would change the Use IRLaser to a RepNotify variable, and move the visual logic into the OnRep_UseIRLaser. That way everyone will receive a notify, and update their visuals according to the new value of UseIRLaser.

Also, you stated that you activate the NVG from a UI, but you have created a RPC function with the owning client, if you press the UI locally, you wouldn’t need that to be a RPC but instead just a normal local function. But obviously, I can’t see everything from these 2 screenshots so you might have different reasons for it. Just wanted to point it out.

Hope it helps!