GEngine* is null when actors instantiate during editor startup?

Hi Teiwaz,

Whenever you need to access GEngine in your code, it is typically a good idea to check and make sure it is valid first. In my case, I always place code that requires GEngine inside an if statement.

if (GEngine)
{
    // Your code here.
}

This will prevent problems when starting the Editor, as well as avoid crashes during runtime if you try to access GEngine at a moment when it may not be available.

2 Likes