How to set TickInterval for an UGameInstanceSubsystem?

I have this class:

class UMySubsystem : public UGameInstanceSubsystem, public FTickableGameObject

I’m looking for the way to set the TickInterval.

Like an Actor:

void SetActorTickInterval(float TickInterval);|

Or like a component:

UActorComponent::SetComponentTickInterval(float TickInterval);

FTickableGameObject has not info about this:

Someone Know how to do it?
Thank you so much!!

Looking at how actor\component ticks are implemented, i can see two ways:

  1. following their example by implementing tick via deriving from FTickFunction instead (i’m too lazy to look into it for now, so i’m stick to second option for now)
  2. Custom throttling, something along the lines (it’s enough for my task for the time being):
void UMyGameplayAbility::Tick(float DeltaTime)
{
	if (TickInterval <= 0)
	{
		BP_Tick(DeltaTime);
		return;
	}

	TimeSinceLastTick += DeltaTime;
	while (TimeSinceLastTick > TickInterval)
	{
		BP_Tick(TickInterval);
		TimeSinceLastTick -= TickInterval;
	}
}
1 Like

It works fine!!
Thank you so much!! :heart:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.