C++ equivalent to "expose on spawn"
What is direct C++ equivalent to "expose on spawn" behavior found in blueprints?
In blueprints "expose on spawn" allows passing values into blueprint's construction script, (as I understand it) technically before object is added into scene.
In my project I have (C++) "init" method (which I call manually) for this kind of thing, but as far as I can tell, that one will be called AFTER object has been added into scene.
There is "OnConstruction" method that can be overrided, but its only parameter is FTransform, so I can't really pass values through it.
So, what would be an equivalent to "Expose on spawn" behavior found in blueprints.
asked Dec 11 '15 at 05:33 PM in C++ Programming
Use SpawnActorDeferred to initialize the variables before spawning the object with FinishSpawningActor although there isn't any way to pass in the parameters within the spawn call as far as i can tell.
Edit : BeginDeferredActorSpawnFromClass is the way to go since SpawnActorDeferred has been deprecated.
Follow this question
Once you sign in you will be able to subscribe for any updates here