Hello,
I’m currently building an interaction system and have created an actor component for my player character which takes care of the line traces and adds outlines to the objects I hover over, which works well so far.
However, when I later tested the whole thing in multiplayer with 2 players, I noticed that my actor component is also replicated on the other player characters without having set it up that way.
The reason for this is probably that (from the Unreal documentation): ‘Static components are components that are created when the Actor is created. Static components do not need to be made to replicate to exist on clients; they exist by default.’
However, it does not say how to switch off this behaviour, of course I could now check in the BeginPlay event of my Actor Component with the help of the ‘Is Locally Controlled’ function whether the component is only executed in the local Actor and then deactivate or destroy it accordingly, but I’m wondering if this is the right way, especially because I can’t find anything on the internet about this topic.
At first I thought that there might be a way to define a component as “local only” or to switch off replication (even across unreal behavior with static components).
What I also wonder: The replication behaviour with ‘Static Components’ also means that the camera component of each player character is replicated, isn’t that unnecessary, why does someone else need to know about the other player’s camera or am I just thinking wrong?