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.
place NewActor into a level, choose its ErrComponet then change its Test variable. You can also change component tags, etc.
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
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.
- Can you reproduce this issue in a new project, with assets other than the ones you provided?
- If so could you provide a detailed list of steps, so that I can reproduce this issue on our end?
- Could you provide screenshots of your issue?
Yes, I can reproduce it with new project. Steps to reproduce:
- Run UE 4.17.1 and create new project (blank)
- Create new actor component blueprint, name it “MyComponent”
- Edit MyComponent and add a public string variable named Test.
- Compile MyComponent
- Edit MyActor and add MyComponent as component to MyActor
- Compile MyActor
- Add MyActor to the level.
- Select MyActor in the level.
- In the Details panel click on MyComponent
- In the details panel edit the variable Test and set it to something like “asdasd”, should be like in the
- Save everything
- Go to MyComponent and click Compile
- Notice that in the level the value of the variable test didn’t change (correct behavior)
- Edit MyActor and add a reference to MyComponent, like in
- Compile MyActor
- Return to the level and check that the variable test is still set to “asdasd”
- Go to the MyComponent and click Compile
- 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:
- Set the variable Test in the level instance of MyActor to “asdasd” again
- Create new actor blueprint named MyParent
- Edit MyActor and reparent it to MyParent
- Compule MyActor
- Notice that the variable Test is still at “asdasd”
- Edit MyComponent and click Compile
- Notice that the variable Test is reset
- Go to output log and find the “LogActorComponent: RegisterComponentWithWorld: Owner belongs to a DEADCLASS” message.
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.