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

I’m not sure I entirely understand what you’re wanting to do, but I think what I’d do is have the text-box entry affect a value in my GameMode or GameInstance (depending on what lifetime this value needs to have) - whenever I change that value have it go to the Game, and then you grab it whenever you need it in the Spawner.

Doing almost anything in the “Constructor Script” part of a Blueprint is very, very rarely the correct answer, as the item doesn’t exist in the world when Constructor is called, so you don’t have access to anything, and a lot of things that you might think about doing there will just break things worse. BeginPlay is almost always the correct place to do startup-only logic.

1 Like