Any ideas why when a player character (either client or server) moves the cube in-game that movement isn’t replicated across any of the connected clients? I just dragged and dropped an instance of the Blueprint in to the level I’m testing.
So I’ve tried messing around with all of the replication check boxes (and adding UFUNCTION declarations to a few functions in the derived Actor class) and it looks like the Cube is now being partially replicated.
I say partially because the results are highly inaccurate…
CLIENT:
SERVER:
I really need the replication to be precise for this Actor - is there anything I can do to ensure it? All of the replication settings are on the Actor itself, I haven’t messed around with it’s components (the collision sphere and static mesh).
What you need is the client to request to the server to move the box and replicate the world transform results back to you and everyone else(SetWorldTransform)… or you need the box to give it’s transform to the server and multicast it to everyone else. This is what Run On Server and Multicast Events are for.
I managed to get the replication working properly by deriving from AStaticMeshActor instead of AActor.
AStaticMeshActor seem to be a fairly simple class so I can probably duplicate it’s functionality reasonably easily (it’d be nice not to have the mesh as the root component so I can scale/move it etc).