i have an Tarray filled with TSubclassOf …the function just uses the UKismetMathLibrary::RandomIntegerInRangeFromStream to get a random array index and returns the vehicle in that index
Well after some investigation it seems that the problem was caused because i used the spawning in the onconstruction function of my actor. This never gets called unless the item is in editor play mode or is being spawned during gameplay,
my actor on the other hand was already present in the level when the level loads…so in the packaged build the OnConstruction function is never called…
P.S. i guess i should have mentioned where this was called when i asked the question, then may someone would have helped me.