Adding Components to Spline

So I wanted to Add these Highway signs on a Road Spline I made thanks to what tutorials I could gather.
Basically after eight Tiles are spawned these Road Highway Signs (If that is what they are called) will be spawned.

So far, so good. Managed to spawn child actors along the Spline. As shown here.

My issues are that the components spawned don’t align with the main spline when I turn it.

When I turn the spline the child Actor component won’t turn facing the direction of the Spline.

Forgot to add example here; what with limitations on image uploads and all.

A second issue is that these highway signs are Actors with a Text Variable that I’d like to edit. I thought I’d put the spawned child actors into an Array, but I do not know what to do after that or if I am even doing it correctly.

Plus I cannot select the child Actors in the editor so I cannot edit the Variables of each spawned Child Actor Individually.

Here’s my setup; it’s all in Construction Script

Here’s my current issues:

  1. The Child Actors do not turn when I turn the Spline they are parented to.
  2. Although I can spawn multiple Highway sign Actors, I cannot edit their variables individually.
  3. Properly placing Child Actor Components in an array.

Construction Script Setup Cont’d:

Have you tried the signs are components? They’re much easier to manage than child actors.

EDIT: I took a standard spline mesh arrangement and added this on the end:

The cubes seem to be following the spline:

EDIT2: Apologies, you do need a child actor comp, gimme 5…

Once you crack the child component open ( on the end of the code there ), that’s a good time to put stuff in an array. Don’t make an array of child actors :slight_smile:

Hello!

Yes the Child Actors are Components.

Thank you; I got the Variables I wanted, and they rotate following the spline, but moved to the center of the map.

I was a bit confused by where to put the set Actor Transform, so I just added it at the end of the Add Child Component Node segment. It’s attached to a Boolean to determine whether to spawn the component on that Spline point.

Also I look at the Array Count and it is insane. there’s about 120 - 477 elements in the Array??? and when I edit the variable it increases even more… I only put eighteen Signs on the Spline; perhaps placing the add to array node has multiplied the array by the numbers of child actor components?

If they end up in the centre of the map, you need to switch local/world mode on the spline location node.

If you only use an ADD node the array will just keep getting bigger. That was just an example to show it was possible.

For the real application, you need to only put each thing in the array once. So use SetArrayElem with the index of the sign ( and tick update array size ).

Heads up: I removed the Set Actor transform because that’s what made it go to the center of the World Map. I followed your latest comment and now when I edit the Text Variable, the Array doubles.

This is what you need to fix the transform:

To fix dupes in the array:

333823-screenshot-3.jpg

I am having problems seeing where the index is going to? On my end I put it in the For Loop, but got the same result.

Edit: The Child Actors aren’t rotating correctly now.

The index is just coming from the spline. Each point on the spline has an index.

I’m not sure exactly how to get that. Sorry for being this difficult

This is my current Setup as of now:

Yes, that’s right.

You aren’t actually setting it to anything at the moment.

When you’ve run the code, you should have at least the right number of elements in the array, no?

That’s what I was thinking too.

Just a clearer version of my setup:

Now only one of them spawn along the Spline, and the array list AND the Outliner show multiple instances.

I really don’t quite know what you’re doing :slight_smile: Sorry.

Here’s my whole setup, it works. Find out where yours differs:

You’re spawning the actor components after every single point in the Spline. I set them to spawn after a set fixed number of spline points spawned. To be more specific, after every other section length of the spline mesh component. That’s why I have the Boolean with the Modulo otherwise I’d have road signs after every single road mesh spawned which won’t look right :slight_smile:

Ok, then you need to do a little computation with your bool and the index to make sure you get the correct array index on the end.

I just now finished copying yours and as expected it worked out - better than mine :slight_smile: Honestly Thank you. I’ll show you what I finally have been trying to accomplish.

Edit: Okay, bit of a hiccup still. Not able to edit the Text Variable. That’s’ the only issue that remains.

Basically where you have the set Array Element I have a Text Variable where it says Target Array

while the Item is the Text Variable from the Cast to - As Highway Sign Output.
333851-

Cast from the child to your sign BP ( there’s a cast in my example ).

Then, you can either store an array of BPs as you go, or an array of the text settings, but to get them you also have to do the ‘get…’ to get the text variable before you put it in the array.

But I mean I did do that right? That’s the current photo I presented to you in my last reply. I am getting the get Text variable from the highway sign.

So now I am so close to completing this. It’s just that when I edit the text variables individually, they reset to the default text I gave them “Highway”.

Is it because it runs in a loop? Since Once I edit a text Variable, it runs through the entire sequence as one loop, and therefore resets any editions I make to the elements? If so, Would I have to use a Do Once node?