Compiling BP actor component resets all variables/throws DEADCLASS error

There is a couple of BP attached. ErrComponent is an Actor component, it simply declares a variable Test.
NewActor BP uses ErrComponent and prints their Test variable at BeginPlay.

To reproduce,

  1. place NewActor into a level, choose its ErrComponet then change its Test variable. You can also change component tags, etc.

  2. Then open ErrComponent and click Compile button. “Test” and all other variables in the level instance of ErrComponent are now reset to defaults.

If you create another Actor based BP and reparent NewActor to it, then repeat steps 1-2 the variables will be reset and DEADCLASS error will be thrown in the output log.

If you delete BeginPlay from NewActor and retry steps 1-2 then the variables will not be reset / DEADCLASS not thrown.

I’m using 4.17.1 from launcher on windows 7

link text

Hey ,

I was unable to reproduce the issue you are experiencing on our end. I have a couple of questions about your issue to help me investigate further.

  1. Can you reproduce this issue in a new project, with assets other than the ones you provided?
  2. If so could you provide a detailed list of steps, so that I can reproduce this issue on our end?
  3. Could you provide screenshots of your issue?

Thanks!

Hi

Yes, I can reproduce it with new project. Steps to reproduce:

  1. Run UE 4.17.1 and create new project (blank)
  2. Create new actor component blueprint, name it “MyComponent”
  3. Edit MyComponent and add a public string variable named Test.
  4. Compile MyComponent
  5. Edit MyActor and add MyComponent as component to MyActor
  6. Compile MyActor
  7. Add MyActor to the level.
  8. Select MyActor in the level.
  9. In the Details panel click on MyComponent
  10. In the details panel edit the variable Test and set it to something like “asdasd”, should be like in the

  1. Save everything
  2. Go to MyComponent and click Compile
  3. Notice that in the level the value of the variable test didn’t change (correct behavior)
  4. Edit MyActor and add a reference to MyComponent, like in

  1. Compile MyActor
  2. Return to the level and check that the variable test is still set to “asdasd”
  3. Go to the MyComponent and click Compile
  4. Return to the level and now the variable Test is reset to the default value (empty)

This is the bug number 1.

To see DEADCLASS message, continue as follow:

  1. Set the variable Test in the level instance of MyActor to “asdasd” again
  2. Create new actor blueprint named MyParent
  3. Edit MyActor and reparent it to MyParent
  4. Compule MyActor
  5. Notice that the variable Test is still at “asdasd”
  6. Edit MyComponent and click Compile
  7. Notice that the variable Test is reset
  8. Go to output log and find the “LogActorComponent: RegisterComponentWithWorld: Owner belongs to a DEADCLASS” message.

Hello ,

It appears that this issue has been fixed internally and will be present in an upcoming engine version.

Have a good day!

Just tested in 17.2 and the bug is gone, it’s working as expected. Btw, it’s not that important, but the “DEADCLASS” message is still here.