Moving a TArray of pointers from BeginPlay() to outside of the function (global) crashes the engine?
A snippet of the code in question is below. The vector,
If it crashes on that declertion in global that means there problem during initiation of std::vector for some reason. Did you try moving it to class deceleration so it will be part of actor class? As long as you won't use UPROPERTY() on it UE4 should not mind it, UObject classes are still normal C++ classes.
Generly if you making some library support for UE4 best practice is to wrap it's API in to UE4 APIs and then use it elsewhere, instead of direly communicating with it
Also do you really need to use std::vector? By look of it you could use TArray too, again without UPROPERTY() this should not be a issue, TArray will simply store pointers
Follow this question
Once you sign in you will be able to subscribe for any updates here