Download

ChildActorComponent gets renamed (and stops showing up) after moving it

Hello everyone.

I’m attemping to create a BP Actor that acts as a waypoint for a number of searchpoints in the map (For tha AI to search), so this actor would have child actors attached to it, and these child actors would represent the locations the AI would search

So basically, I have the actor in the world with some setup variables like this.
I have a construction script(1,2) so that Number Of Points resizes the number of Search Sub Point Locations. And a while loop to create child actors equal to the Number of Points.

I store these child actors in an array so that after I have created all of them, I can set their relative position to whatever value I have specified in Seach Sub Point Locations.

The problem is, when I change the value of Seach Sub Point Locations, the child actors gets renamed from NODE_AddChildActorComponent## to TRASH_ChildActorComponent## and they’re no longer visible in the world.

If I use this button to remove the child actors, the construction scripts adds them again with the correct location (and back to the normal name) and they’re visible in the world, as you can see here, I’m able to see both child actors (The ones with the target sprite) and the main actor.

It’s a design tool I’m trying to build following an old (UE4 4.7) AI tutorial, and in this tutorial the instrutor doesn’t come across this problem, so I’m assuming there’s something that changed.

I guess, if don’t come up with a solution, I could just keep pressing the “Remove All Elements” button I mentioned earlier to check their updated position but that would slow down level design a lot, I’m really out of ideas, so I’m asking you.

Thanks for taking some time to read this!

I had this exact thing the other day, except with meshes.

The only work around I could find is add the child actors on begin play ( so they’re in the game ), but also add them every time the construction script runs.

The coordinates are permenent, but the children will only stay when added at run time…

Thank you, that works!

But as I was messing with this a bit more, I came up with a better solution!
Basically I’m clearing the array of child actors and destroying them everytime the construction scripts runs, that way it “refreshes” the damaged child actors and creates new ones. I’m able to move them in the editor and see it happening in real time.

To be honest I don’t complety understand why this works but hey, that’s how we roll I guess…

Ok, that’s nice too… :slight_smile: