Struggling a bit with this here, right now I just have this:
void UReturnFireWeakpoint::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
GetWorld()->GetTimerManager().ClearTimer(FireTimerHandle);
}
Which seems to be the right way to clear an object’s timers and things on destroyed or on level change. I noticed my game would sometimes crash with an odd error so I wanted to clear these things when the object was destroyed because the error seemed to be coming from timers not being cleared, but after changing to EndPlay, all of my components cause the game to crash because, I think, they can’t get the world. I could be wrong though.
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000210
UnrealEditor_Engine
UnrealEditor_ACTGDFPS502_9894!UShieldWeakpoint::EndPlay() [EditedToHidePath\ShieldWeakpoint.cpp:59]
The error is for a different weakpoint object, but they all point to the same location which is the same for weakpoints, since most of them just need to clear a single timer.