I recently came across a problem that my replication is not working. I have already tried to fix this many times and searched for information on various forums.
Get to the point. I have a function that does 3 basic things. 1 spawn objects, 2 delete objects, 3 upgrade objects to a new level. The function works fine on the server side, but nothing works on the client side. The function performs its actions, but it is not visible either on the server or the clients
if the player calls a function on the server, it will use the server variables.
ie you have a BuildingMode enum that isnβt replicated, so when you Multicast BuildObject each actor will use its own version of the variable.
what you need to do is either
Pass the variable to the server as an input on LeftMouseButton(server )and replicate it
OR
when you set that variable, set it with a Server RPC and replicate it back.
this goes for all player defined variables, so for instance BuildModeOn? etc
Thank you for your reply. BuildModeOn is a variable that each player has their own. It seems that I just donβt know much about replication and I should take a closer look at This topic. But thanks anyway.
Make sure to set the Actor that you spawn on the server to be βReplicatedβ. This way it will also appear on each client and also dissapear if you delete it while on the server. For running upgrading code or anything really you can use a simple ROS and a MC event to replicate it. Simple