How to adjust tick rate in TickableWorldSubsystem

I’m wondering how I might adjust the tick rate for a tickable world subsystem. I’ve been looking through the documentation and found plenty of ways to disable it, but I wondered if there was any inherent function to change tick rates similar to blueprints.

2 Likes

because a subsystem is bound to the object it is a subsystem of, and those objects “just tick on the frame” apparently they do not have a TickComponent to modify, so if you want to set TickRate for a subsystem you will probably either need to pull in Delays/Timers or go with an Accumulator approach.

UMyWorldSubsystem.h

float TickAccumulator = 0.0f;

void UMyWorldSubsystem::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    TickAccumulator += DeltaTime;
    if ( Tick Accumulator >= 0.1f )
    {
         // do "fixed tick" logic here
         TickAccumulator = 0.0f;
    }
}

the 0.1f is just a magic number, but editing even a public member of a WorldSubsystem in the editor is tricky because WorldSubsystems does not exist until the World exists (so no earlier then PIE)
at the vary least if the magic number is in the cpp it can be tested with LiveCoding.

1 Like