Spline Component replication not replicating contents

Making my spline movement system multiplayer capable, I found, that spline component contents to not get replicated. I have several moving objects (flying birds). All players should see them moving along their splines identically and splines get changed on the fly, e.g. switching from some endless loop towards a path to a navmesh point seamlessly. Works perfect in single player.

Just using Replicate Movement on these actors results in stuttering movement on client side, so I decided to keep movement local and replicate the spline infos to newly joined players along with the spline time.

This works, but I found, that splines are not really replicated as I expected and that I need to do quite some manual work. Took me some time to find out the following:

Spline component added to flying actor using green “Add component” button. Setting checkbox “Component Replicates” and even calling “SetIsReplicated” . Result: new player joins and sees the actor flying along the “default” spline with 2 points, length 100. Same with Spline component added by Blueprint “AddSplineComponent”.

One solution: Just keep a reference to a spline store somewhere else in the spline component variable. (I had this before in a MAP, but for example maps cannot be replicated). So I changed the complete system to local spline components - which seems to be much more straightforward and simpler in code. I do not want to revert back to such a solution again.

The other solution: Copy all relevant content (spline point structure array, spline duration, isClosedLoop) to separate variables and replicate these. In BeginPlay, for remote role copy this information back to the spline component - this works.

Now I wonder, how Spline Component replication is supposed to work. Is it by design, that spline content is not replicated - so what’s the use of it?

BTW: Getting those warnings

LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: SplineComponent /Game/MpFps/Maps/UEDPIE_0_Level01.Level01:PersistentLevel.BP_Test_2.NODE_AddSplineComponent-0 NOT Supported.

These happen, when I call AddSplineComponent and have replication set for the spline. This makes me believe, that Replication with Spline Components is something not really intended to be used. I mean, just having a checkbox available does not necessarily mean, that it is good to use it at all…

I have the feeling, that my approach of copying all content to extra variables also might not be a good idea and want to avoid a complete rework again later just because doing things too complicated now. Thanks a lot for any thoughts.

1 Like

according to the docs on component replication, the checkbox “component replicates” has different effects, depending on whether or not your component is “static” or “dynamic”

static: created with the actor in its constructor as Default Subobject or in the Blueprint Editor’s component mode

static components are

  • always created with the actor (both on client on server)
  • they are created, not replicated, thus “component replicates” unchecked doesn’t remove them
  • “component replicates” checked however is necessary if the component itself wants to do property replication (the docs don’t say anything about explicit RPCs)

dynamic components are those that are created at runtime on the server (I guess, you can still create a component at runtime on server and client and that would mean, all of the above applies like it were “static”)

dynamic components are only replicated when the “component replicates” box is checked, otherwise their existence is limited to the server (assuming they were created on the server)


There doesn’t seem to be an easy way to replicate what you call “spline contents”, i.e. the defining parameters of the spline with the spline component itself.

I will probably implement your workaround and have separate variables for the relevant paramters, mark them as replicated properties and implement a replicatedUsing function that then applies the parameters to the spline.

BTW: Getting those warnings

In principle this warning refers to a serialization problem: the object in question isn’t set up for serialization and thus can’t be transferred via replication. I don’t know why this should apply to NODE_AddSplineComponent, though.