Hi, I have created a laser pointer for my VR character… The app is MP so I have to replicate this properly. I have tried Multicasts wit RunOnServer Events and the beam gets replicated but I wont get destroyed on the client when I release the button.
I would be thankfull for any advice.
Thanks in advance
You have the reference replicate. With Multicast, every single instance of that on every single machine runs it. So the server gets it’s own reference, and that will then replicate over to all the other clients that already got their own reference from the multicast. So I’d stop that from replicating and have each client have it’s own reference to it’s own spawned system.
Additionally, you can tick “Auto Destroy” on the “Spawn System” node.
Hi Steven, thank you for the quick response. Not sure how to achieve this… How I can make each client have its own reference? Thanks
You already do. You call a Multicast. This means every PC runs the code as if it’s a single player game, all getting their own references to their own spawned systems, completely separate from all the others. LaserMulti runs on ALL computers. They all get their OWN spawned system. They ALL get their own reference straight after. But because the reference is set to replicate, then the Server reference overwrites all the other computer references. Just have it set to not replicate and the server won’t wipe all the client based references and replace them with it’s own.
Okay I removed the replicate on the reference object but its still not working as it should. The Client can see the servers laser but it not gets turned off when I release the button and the server can only see his own laser the client’s is invisible.
Thank you. The ServerEvent was set to multicast Everything works as it should.