I have this weird error where if I compile the 2nd time after opening a project. It just Crashes. I think the cause of this is one of my classes that inherits UObject is inheriting from FTickableGameObject. The first compile runs successfully, but after compiling again it just crashes. One of the things I notice is, When i play the editor and stop it and compile again it does not crash. Every time I compile the second time is crashing. Lol
I don’t really know what’s going on here.
*Sorry. I am using a DeepL translation, so some parts may be difficult to read.
I encountered a similar error myself, so I did some research by following various lines from line 40 of TickableObject.cpp and found that I could just mimic part of the processing of UTickableWorldSubsystem, which is an EngineAPI.
The following is a concrete means.
Declare the variables written below as private in the header.
“bool bInitialized = false”.
Declare the function written below in public in the header.
“virtual ETickableTickType GetTickableTickType() const override”.
“virtual bool IsAllowedToTick const override final”
add the process written below to the beginning of the Initilize function.
“check(!bInitialized); bInitialized = true;”
4.Add the process written below to the beginning of the DeInitialize function.
“check(bInitialized); bInitialized = false;”
5.Add the process written below in the GetTickableTickType function.
“return IsTemplate() ? ETickableTickType::Never : FTickableGameObject::GetTickableTickType();”
Add the process written below in the IsAllowedToTick function
“return !IsTemplate() && bInitialized;”