Spawning works in PIE and in standalone but fails in packaged builds

I am spawning vehicles on to the level using the following code…

GetWorld()->SpawnActor(*GameSingleton->GetRandomVehicle(), Position, SpawnRotation);

it works perfectly fine when playing in the editor or when using standalone game… but the vehicles are not spawning after i package the game (win64)

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

the problem with the packaged build is that it doesn’t throw any error …i am getting no errors in PIE mode either…

What error do you get? How does GetRandomVehicle work?

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.