Self zeroing blueprint child class values

I’ve run into problem, in which editor zeroes value in my class after every restart if the class object of this class is referenced somewhere else. I was not able to reproduce it in another project, however I can reproduce it always in project I’m currently working on.
I’ve made a video that shows everything i found out about this issue to better visualize it.
Removing all temporary files from project did not resolved issue.
I can give You link to my project files in Private Message.

→ link to video ←

HI dzarafata,

I did try to reproduce this on my end but was unsuccessful. Do you have any circular references in your project? If so, that may be causing the error you are seeing.

i couldn’t find any explicit references from PlayerCharacter_BASE to MyGameInstance or MyPlayerController, so I don’t think that’s the case.
As a simple work around I just added code to construction script that set those variables to desired values.

Do you have any steps I can take to recreate this error on my end?

Sadly (or maybe not sadly) it seems very hard to reproduce. In my current project it happens every time, but when i tried to do it in clear project, i couldn’t reproduce it. I’ll try to learn exact steps needed to trigger this bug this weekend

Hi dzarafata,

Did you have any luck reproducing this error? If so, what steps can I take to recreate this on my end?

I had bad luck of reproducing this error in another project. UE4 crashed (together with Oculus and GPU driver).
When I turned project on, my EnemyMelee which is child of Enemy has started to loosing mesh, animation and location every time i turn the project on again.

I’m not sure if the crashed was the case or just a coincident.

I have actor that spawns enemies. If I remove EnemyMelee from spawning, then it’s not loosing values on restart.

And of course, I still have no idea what is causing it. This new project is pretty simple, just for my university. i just have a branch that select which enemy type spawn. First time it’s EnemyMelee, next time its jusst Enemy.

Can you send me a sample project where this is occurring? I’ll be happy to take a look and see what might be happening on my end.

OK, i removed most of the stuff from this new project. file have 45 MB so I’ve put it on dropbox.

https://www.dropbox.com/s/87b2ivkj9g6j9ms/VertexPGOculusShowUp_UE4_BugReport.?dl=0

Values that are loosing after editor restart are those in /Content/Actors/EnemyMelee.Mesh.
I’ve tried those values:

Which specific values are being reset?

Skeletal Mesh, Anim Class, Location, Rotation. Pretty much everything that is on the screenshot.

In Enemy there is event _fireLoop which spawns BlasterBolt actor. If i remove the Spawn Actor from Class node from this event, the values stop being reset.

The BlasterBolt on collision check if it collided with Lightsaber by casting, so BlasterBolt references Lightsaber.
Lightsaber on the other hand, checks periodically if all enemies are dead, and if so, it turns off.

So references seem like this:
Enemy->BlasterBolt>Lightsaber->Enemy.
There is circular reference, so that may be causing trouble.

Why is it causing troubles? I think there should be at least some warning message.

EDIT: Yup, I’ve moved code that referenced other actors to PlayerCharacter to break reference circle and the values stop to reset.

I think that at least a warning about that should show somewhere in editor.

Hi dzarafata,

The reason this causes an error such as what you are seeing is because the Enemy reference needs information from Enemy to be able to fill the information for the Blasterbolt and Lightsaber. When this happens, the assets get stuck in a loop of requesting information. Instead, try passing the information you need from enemy all through to blasterbolt/lightsaber, instead of requesting the information. This allows for a linear progression and should prevent the circular dependency from overwriting your other information.