Someone reprimand me if “necroing” threads is frowned upon, but I just thought I’d add my experience for anyone else who comes across this issue.
In my case at least, my UMaterialInstanceDynamic was getting garbage collected. I don’t really know enough about UE scope and how they store UObjects, but I think my problem was that I use a TArray<FSkeletalMaterial> to change materials, so that was stopping the engine from storing the materials.
My solution was probably primitive, but I just now store the TArray<FSkeletalMaterial> as a member variable for the owning actor so it’s scope stays with the actor.
EDIT: This advice is trash, please disregard. Bug still active. Will report back.
EDIT2: I figured out what my problem was, I was using a TMap of pointers to the dynamic materials that I had set up, because I thought it would be faster than re-creating the dynamic materials and setting the scalar parameters.
Grabbing those dynamic materials from the map seemed to work most of the time, but that was how I was ending up getting the random access violations.
I ditched the TMap and now there’s no problems and it actually runs faster.