How to set a variable of an AActor before it is spawned by using Textbox input?

I didn’t find the solution, but I realized to use the cast to Soldier3DTDGameMode_BP instead of cast to Soldier3DTDGameMode , because that is what I am using in the project as a default gamemode.