Getting the world context to spawn an actor
I am trying to spawn a group of actors after parsing through a file to get some features which would apply to these actors.
The workflow I'm using is - Parse file -> create objects -> Apply these features to a Mesh object (AActor). I find that the best way to apply these features while spawning an actor would be to use
This code worked well when I was putting all of it in the Actor Component Class and then would drag a point light actor in the editor and add this particular component to it. But now I want it to happen as independent actor spawning.
I am not able to figure out what the world context would be to spawn these actors (Since one of these would be the first actor to be spawned). I tried getting a world context from the GEditor object but that just spawns actors that are visible in the actor list on unreal but not in the editor viewport.
From what I read an actor is always required in the scene to obtain the world context which would be used by other actors to spawn. But then how does the very first actor get spawned?
Is my workflow correct? How should I get the world context so that I can correctly spawn actors?
asked Nov 07 '18 at 09:29 PM in C++ Programming
Instead of GEditor try the world in the GEngine.
answered Nov 12 '18 at 04:23 PMBrian Johnstone (suspended)
Follow this question
Once you sign in you will be able to subscribe for any updates here