Dear Community,
Yay it is that happy time again!
This is a thread where you can post compile errors you’ve solved during 4.12 upgrade, issues you have questions about regarding 4.12, and generally share anything you’re learning as you do the upgrade process!
I contributed this BP nodes which you can check out the C++ for in the relevant classes:
Actor Functions
Was Recently Rendered: Extremely powerful node to let you perform game code optimizations based on whether you know the actor is being rendered, or has been rendered recently. Actors that have not been rendered for awhile can stop running functionality that is important, but not if the actor has been out of view for a long time!
bool AActor::WasRecentlyRendered(float Tolerance) const
{
UWorld* World = GetWorld();
return (World) ? World->GetTimeSeconds() - GetLastRenderTime() <= Tolerance : false;
}
Get Time Since Creation: This is very useful for actors that you create during runtime and want to know how long they’ve been around for! Their runtime-lifetime basically
float AActor::GetGameTimeSinceCreation()
{
if(GetWorld() != nullptr)
{
return GetWorld()->GetTimeSeconds() - CreationTime;
}
// return 0.f if GetWorld return's null
else
{
return 0.f;
}
}
Rama