Why is FTickableGameObject::Tick() being called in the editor?

Hi everyone.

Sorry for posting on such an old thread but I was running into the same issues just today and didn’t want to run some if check inside the tick method. It turns out that the register method gets called inside the FTickableGameObject constructor, which then obviously means that the CDO also starts ticking it self along with whatever extra objects get created (like others already mentioned).

However Epic them selves have a workaround in the engine code to prevent this without having weird workarounds inside of the Tick method it self. Figured I would share it!

Override this method in the header file:

virtual ETickableTickType GetTickableTickType() const override;

And inside the cpp file implement it like this:

ETickableTickType YOURCLASS::GetTickableTickType() const
{
    return HasAnyFlags(RF_ClassDefaultObject) ? ETickableTickType::Never : ETickableTickType::Always;
}

Hopefully it helps anyone.

7 Likes