[Bug Report][Reproducible] Child Actor Component's Class clears on editor restart

This is a reproducible bug report of a bug that people have been reporting recently on 4.7:

Branch: Binary

Build Version: 4.7.0-2455222

Repro Steps:

  • Create a new project “ChildActorNone” from blank template with no starter content
  • Create new blueprint “MyPlayerController” by subclassing “PlayerController” blueprint
  • Create new blueprint “MyChildActor” by subclassing “Actor” blueprint
  • Create new blueprint “MyActor” by subclassing “Actor” blueprint
  • Create new “ChildActor” component in “MyPlayerController”
  • Set “Child Actor Class” property of “ChildActor” component in “MyPlayerController” blueprint to “MyChildActor”
  • Create new variable “MyActorVariable” of type “MyActor” in “MyPlayerController”
  • Create graph in “MyPlayerController”:

  • Create graph in “MyActor”:

  • Save everything
  • Close and reopen editor
  • Notice how “Child Actor Class” property of “Child Actor” component in “MyPlayerController” blueprint has been set to something like “PLACEHOLDER-CLASS_MyChildActor_C_0”

Hey Mastodon,

Thanks for reproduction steps! This was really helpful, and I was able to reproduce this issue in 4.7.1 as well. I checked it in our internal build as well, and it appears that issue has already been fixed. This fix should be included with a future release.

In meantime, it appears that cause is circular dependency; MyPlayerController is getting a reference to MyChildActor, which in turn references player controller. This is generally to be avoided if possible, but it looks like this particular bug won’t be an issue for much longer. Thanks again for narrowing it down for us!

You’re welcome . Glad to help.

I suspected culprit was a circular dependency during asset loading.

So is this on track to be fixed in 4.8 or 4.7.2 (if there will be one)?

What would be a good work-around in meantime? Other than just removing all circular dependencies.

Thank you for your help.

My guess would be 4.8, though if we do Previews again (I suspect we will) you’ll see it there first. I think 4.7.2 will be too short notice for developers at this point, if they decide to push that out.

Removing circular dependencies is definitely your best bet, though I know that can be difficult and workaround will depend on what you’re trying to achieve. I’ll give it some thought for type of setup you’ve got here and let you know what I come up with.

Hi , I understand this is fixed in an ‘internal build’ - which Github branch would I need to pick up to obtain this fix, is it ‘promoted’ branch or ‘4.8’ branch?

Some additional thoughts:
I realize using a build on bleeding edge of development is risk prone (as I only just migrated from 4.6.1 to 4.7.1 with some effort), but this issue is quite a thorn right now as I have to manually set up child actor class whenever I start editor, obviously not fun!

Also just started having this problem after updatin to 4.7.1 and again after 4.7.2 with random blueprints that have absolutely no circ. dep.
Random child actor components are cleared after editor restart.

Promoted is probably most stable option, and most recent Promoted is pretty close to what I tested this on. Master is updated whenever any change is made, so it can be severely unstable.

Hi Rashura,

If you don’t have any circular dependency in your blueprints, it’s probably a different bug. Can you create a new post with as many details and reproduction steps as you can? We can take a look there. Thanks!

Similar issue. If I have a child component and a variable of same type whenever editor restarts child component is set to none. child component is an actor with just a few float and integer variables with no logic.

Same here, mine’s not a circular dep issue either (although there are macro libraries involved and those are often culprit), so I can confirm that fix mentioned in from internal build(s) doesn’t work for me.

For now I’m working around this issue until I can set aside some time to properly focus on this (I understand 's suggestion is to file a new report).

Others feel free to pitch in with any repro if you already have one, sadly I haven’t been able to repro this outside my own project.

Hi all,

We’ve seen a few varying cases with which this happens and we believe it’s been fixed, but we weren’t able to get it into 4.7 because it is an API breaking change. It’s possible that simply using GitHub commit won’t fix this for everyone. best way to test this right now would be to get Master branch and open a copy of project there.

To work around it for now, as long as you don’t have bad cyclic dependencies, you can try disabling deferred dependency loading (bDeferDependencyLoads=false) in BaseEngine.ini.

Thanks , your workaround did trick! Just curious - what are downsides of setting bDeferDependencyLoads to false?

PS: I didn’t just pull a particular github commit to test fix (in fact I don’t even know which commit it is!), I built an entire promoted branch around first week of March so I’m a bit wary of whether latest fix covers all variations of issue in question.

If you have circular dependencies that could cause a crash, bDeferDependencyLoads will prevent project from crashing. With it disabled, you’re running that risk.

Mike Beach was able to get a non-API-breaking fix in for 4.7.4, which should be released officially very soon, and I’ve been getting various confirmations that this bug has been fixed by it. If you’d like to test it sooner than that, grabbing a 4.7 build from GitHub should do it.

Thanks for explanation! I’ll probably wait for 4.7.4 to test.