Download

WorldInfo ever destroyed?

I’m curious about the “mysterious” WorldInfo class. Whenever you log it’s instance name, it will always show as WorldInfo_0, implying that only one is ever spawned during running the game (even after changing maps).

However it’s PreBeginPlay() executes each time you load a new map. And it seems that it’s Destroyed() method is never called (if I try to log from it), so how are any of the actors it spawns cleaned up?

So does anybody know what the deal is with this class?

The reason I ask is that I need a single actor to handle SetTimer()'s for actors that have their Ticks disabled. So, as WorldInfo seems to always be available, I’m spawning an Actor in WorldInfo so I can set timers like so:



WorldInfo.MyTimerActor.SetTimer(1.0, false, nameOf(SomeFunction), self);


But i’d like to be able to clean-up this Actor when switching maps/loading-save-games, but it’s Destroyed() is never called (even though it’s PreBeginPlay is called each time i load a map).