Unitialized DataAsset in AActor::OnConstruction
In the project I'm working on I'm using the OnConstruction function in an actor to update some properties using a custom DataAsset everytime the actor is moved in the editor. As long as I'm editing the level or it's the first level loaded into the editor this is fine, but if the editor opens to a different level and I then load the level my actor is in then the DataAsset I'm using just isn't initialized.
I repro'd this with the following steps:
This should cause the check from step 6 to fail. I have found that a workaround for this is to open the DataAsset from step 4 in the editor before opening the level but that's not foolproof since it's entirely possible to forget to so that (or just not know that's required since I'm not working by myself).
Attached here is the repro case that I created. This also occurs in 4.12 so doesn't seem to be a new bug.
asked Sep 27 '16 at 11:13 PM in Bug Reports
I was able to reproduce the error (the check not being triggered) when using File->Open Level to open the level from step 7. However I also found that by double clicking on the level asset in the content browser I did get the check to trigger. This leads me to believe that, rather than the data asset not being initialized, there is a difference in the way the level is loaded that is causing the issue. This difference in level loading has been reported here: https://issues.unrealengine.com/issue/UE-36532 . You can track the report's status as the issue is reviewed by our development staff.
answered Sep 28 '16 at 02:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here