How to get ue4 to stop garbage collecting my spawned actors?

Actors definitely get GC’d, no exception there really. The way to prevent them getting GC’d is the same way you prevent UObjects and other GC-able objects from getting GC’d - you create a hard (read: shared) reference to the object. Sounds like something else is afoot in your specific situation but I can’t work out what.

Is there any way you can store these actors in a blueprint array instead of C++? All ptr variables in Blueprints are automatically protected from GC as long as the addresses are valid. So maybe you can have a BP inventory class that inherits from your C++ inventory class? Not at all ideal considering how you’ve built this, but it would at least help us all understand the issue here.

For testing purposes, this is how you would access the BP variable from C++ code: Access BP variable in C++ - #4 by andrea.b