I’m currently working on a multiplayer shooter, and I’m trying to implement weapons. To do so, I wanted to use actor components, so I created a blueprint that is a subclass of Actor Component.
In my actor blueprint, I did this:
The problem is: my component doesn’t replicate The “SERVER” log works fine, but there is nothing on the client logs. Same goes for the “TIIIIIICK” log (on the server but not on the client).
In my actor class defaults, I checked the “Replicates” bool, and I did the same with the “Component Replicates” bool in the component:
This behaviour is apparently normal, because you have to spawn the Actor Component on both client and server side in order to have it replicating.
One detail that isn’t: you absolutely have to spawn the component on the server and on the client with the same node. This is how the engine knows that it’s the same component!
So I suggest to have a replicated event (multicast, executes on all), that calls the “add actor component” node. That way, if you call your replicated event, it will be the same node on the server and on the client, so the actor component will replicate.
If I’m wrong or if I missed something, please tell me
im not sure, but i think that if you spawn the component on the server (only) and set it to replicate, then unreal will spawn it on the client as well.
so technically you don’t need an rpc.
im not sure so i’d be happy to know if that’s right or not.