Does anyone know why SetTimerForNextTick
is called on the same frame inside a client RPC? I’m doing something like this:
void AMainGameState::Multicast_DoGameTransition_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("Frame outside: %i"), GFrameCounter);
FTimerDelegate TimerDelegate;
TimerDelegate.BindLambda([this]
{
UE_LOG(LogTemp, Warning, TEXT("Frame inside: %i"), GFrameCounter);
});
GetWorldTimerManager().SetTimerForNextTick(TimerDelegate);
}
…and the frame number is the same for both logs when called on a Client
, but for a ListenServer
the frames are different, as expected.
(What I’m trying to do is to instruct the clients to do a game state transition by capturing a screenshot of the current state and do a fade into the next. Since grabbing screenshots to use at runtime needs to be done inside the UGameViewportClient::Draw
method, I need to delay logic until the next tick.)