How To Set Instanced Child Actors In Duplicated Blueprints

Hello,

Let’s say I have Blueprint A with Child Actors 1, 2, and 3.
Then I decide to duplicate Blueprint A → A’

What I noticed is if the Child Actors are called in Blueprint A’, instead of calling 1’, 2’, and 3’, Unreal still calls 1, 2, and 3, which is being used in Blueprint A.

To work around this, I have duplicated 1, 2, and 3, but this takes a long time, and I’m sure there’s a more efficient way to instance Child Actors in duplicated Blueprints.

(To better illustrate this, I’ll give the example of using child splines and Blueprints. In the duplicated Blueprints, instead of using the new splines, it calls the splines in the original Blueprint. So the objects teleport to where the original Blueprint is, instead of using the relative transforms of the duplicated blueprint.)

An Addendum:

If I had Child Blueprints or instances of the same Blueprint in the level, how would the Children Actors of those Blueprints behave?

Would Unreal automatically (re)-index them?

Because, if so, creating Children Blueprints may be better than duplicating them, altogether.

Again, with the Child Actor Splines, I’d imagine using multiple instances of the same Blueprint would HAVE to (re)-index those Child Actor Splines, because how would they work, otherwise?

:face_with_spiral_eyes:

But I don’t know, so I’m hoping someone could enlighten me.

I would not use child actor components especially if you plan on sharing the child actor between blueprints. (it’s always been rather buggy especially with replication)

Why not just use a soft object reference and use “Attach Actor To Actor” or “Attach Actor To Component”

I started in 2022, and I am a voracious learner, but experience is what I do not have, so, unfortunately, this was an unavoidable situation.

The reason is because the splines need to be in specific locations, and I need to be able to see those locations as I edit them. Unfortunately, because the splines are attached to parents themselves, I can’t even use the default Transform anymore without starting over:

These are boarding and disembarking transforms for the player character as they get off and on trains.

If you are indeed correct, and I’m out of luck (and will have to roll up my sleeves), so be it. I’ll let the topic stew for a few days, and if neither you, I, nor anyone else comes up with a solution, I’ll credit you and mark this “solved”.

I’ve run into a few problems like that in the past too.

You should be able to populate the splines ok - when you get the LocationAtDistanceAlongSpline, make sure to set it to world space, and then the same for your meshes when adding them.

Also, the CACs seem to call their ChildActors construction script at a time when things aren’t all set up - but if you move your code from the spline BPs construction script into a function, then in your main BP, call that function from its construction script:

Hello, Recourse,

I think I’m beginning to pivot (no pun intended), because this is confirming my concern about replication, and I really, REALLY don’t want to deal with bugs right now (be it Unreal or my own ignorance).

So, what I was planning on doing was, instead, creating multiple splines in a Blueprint, so if I were to duplicate that Blueprint, the splines, as with all local components, would be instanced/(re)-indexed.

The problem (as I shared with 3DRaven not long ago) is that when I call the Path of a Spline from a Blueprint in the Level Sequencer, I can’t figure out how to tell the Level Sequencer which spline to use; it always uses the same spline.

Yeah if you can pivot away from them - 3DRavens right that they don’t behave nicely with replication, if you can use other methods it will probably be less painful.

I posted that more as a reference, as I got the impression you wanted to keep them. I’ve been able to directly edit each spline in CACs in prefabs and populate them in editor and PIE by following those steps.

Wishing you minimal bugs and rapid development!

1 Like

@3dRaven , @RecourseDesign

So, someone at Epic has confirmed that we cannot have more than one spline in a Blueprint when using the Level Sequence:

This is a tough lesson. I’ll do it manually this time, but moving forward, when it comes to replication, I will NOT use Child Actors.

Thanks for the insight!

1 Like

@RecourseDesign , @3dRaven

This is an FYI:

So I just remembered something I did a while back, and that was to use the “Get_Child_Actor” node for something unrelated.

I tried it here, and, VOILA! The Child Actors are referenced like local components.

I’m still going to avoid Child Actors in the future for replication purposes, but maybe this will help someone else out. Replicating is annoying, in general, but totally possible with Child Actors. But, I feel this should be a last resort situation.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.