I’ve read much so far on replication in UE4 and I wanted to see if my understanding is correct and few questions about replication.
Please correct me where I’m wrong
What I’ve learnt so far
-
Setting a variable to replicate will replicate its values on the server to all the clients.
-
Calling a function marked server will only run on the actor in the server
-
calling a function marked client will only run on the actor in the owning client
The questions:
-
If you spawn an actor on the server when and how would their replicated simulated proxy spawn on the clients? Can you control on which clients the replicated proxy must exist? and do any functions called on server object ever replicated to client version if not marked to replicate like if I want character to walk forward I’ll have to call it on both server and client to make the animation work on client isnt it?
-
What defines the roles for the actors i.e can you set it manually to get desired behaviors or is it assigned automatically based on how it was spawned and what class it belongs to, like is pawn always simulatedProxy and PC always autonomousProxy?
-
If I want to spawn something that is just cosmetic (e.g. gun muzzle flash) and hence irrelevant to server I would like to spawn it only on the client , do I need to always use multicast for such cases?
-
Who owns the object placed in the level while it was being designed in the editor, how is replication handled for those? are those server owned ?
-
If an object is spawned by game mode then there might be no playercontroller in its owner chain can this object call replicated functions?