When starting the engine from an IDE and with Camera Sequence Assets present in project’s content, following line throws an exception:
if (ensureMsgf(Registry, TEXT("Typed element was requested for '%s' before the registry was available! This usually means that NewObject was used instead of CreateDefaultSubobject during CDO construction."), *Object->GetPathName()))
If I press “Resume” a couple times the engine starts anyway. Is there a way to suppress or fix this? I doubt camera sequence assets are supposed to spam errors by just being present in the project.
This error message is caused when the engine is trying to access an object that is not yet available in the object registry. This is likely due to an issue with the initialization order of the objects in your project.
One way to fix this issue would be to ensure that the objects that are causing this error are initialized properly before the engine starts. This can be done by making sure that the objects are created during the CDO construction phase, instead of the NewObject phase.
Another way to fix this is to check if the object is null or not before trying to access it. You can do this by using the “if (Registry)” check before the “ensureMsgf” check.
Alternatively, you can suppress the error message by removing the “ensureMsgf” check, but this will not fix the underlying issue and it’s not recommended as it will hide the problem that needs to be fixed.
Finally, you can try to move the Camera Sequence Assets to another folder and see if it still throw the same error, if not, check the folder where you have the asset and try to find if some of the assets have any errors or missing dependencies.
Thanks for reply.
I noticed it doesn’t matter what folder the asset is in, it will still throw an error. This behavior translates to other projects I create as well so I suspect I might have issue with my engine in general, even though I got it from Epic Launcher.
I did not add any code to rely on this assets or manipulate it in any way. It seems that this error occurs if a camera sequence asset is just present in the project.
I would also like to add that those assets work perfectly fine. I can open them, edit, use them with systems like camera shake and encounter to errors. The only issue is during engine startup but doesn’t affect the editor or runtime phase, so that’s weird.
I had the same issue but found a solution that works for me. If i understand it correctly, the error is caused by having the camera in memory even tho it only exists inside of the animation sequence, meaning that its trying to access an object that hasnt been initialized yet? might be wrong but here is a solution that works for me:
using a soft reference to the CameraAnimationSequence and loading it asynchronously at runtime.
like this there is no hard reference to an object that doesnt exist yet. so the editor doesnt crash anymore on startup
I had actors which had “Instance editable” fields pointing to camera animations sequences so I could play an animation after an overlap event; changing this to a soft instance AND making sure the default value of the “instance editable” field was null / clear fixed the issue… (2nd part is critical too)
I had to add “if (Registry) { …FUNCTION CODE… }” in the void UEngineElementsLibrary::RegisterActorElement(const AActor* InActor) function to get the editor to load, then apply the above change to any actors referencing animation sequences.