Seems about right. More generally, actors spawned on server should be deleted on server. Actors spawned on client should be deleted on client. Replication isn’t really relevant here.
You shouldn’t ever have to switch contexts in your system. Spawn actor → Add to GC, should be enough, no need for server events.
Also, game state class cannot trigger server events from client, so this :
will not work when executed from client context. However it’s probably not the cause of your bug because you’re already calling it from server context…
I’m more intrigued by this :
Where is this called from ? If called from client context, again, it won’t run. Maybe that’s why your stuff doesn’t work. Otherwise I don’t really see anything wrong.
Also, there’s no point in delaying 5 seconds before clearing. You can loop and clear immediately.
Lastly, I see you added a bunch of print strings, which is good. How about them ? What does your setup print ? You might want to even add some more to figure out what’s wrong.
On another note, may I suggest a slightly different approach - Actors have a Tags variable which is simply but an array of strings, which you can fill at will. So instead of tracking them in an array, just give them a “GC” tag after spawn. Afterwards, you can retrieve them with GetAllActorsWithTag(“GC”).

