I’ve been getting some crashes when I set a timer, and call a non-empty function. It doesn’t seem to matter much what I put into the function. I set the timer in the constructor:
ABomb::ABomb(const class FPostConstructInitializeProperties& PCIP): Super(PCIP) {
GetWorldTimerManager().SetTimer(this, &ABomb::Explode, 5.0f, false);
return;
}
void ABomb::Explode() {
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Boom!"));
return;
}
Then, whenever I run the editor, it instantly crashes.
I have no idea what I’m doing wrong. It seems fairly simple, so I don’t know what more I can tell you.