How do I Spawn an Actor from a custom Editor Window?
I am attempting to Spawn an actor, but all the previous methods use GetWorld()->SpawnActor. However, from a custom SWidget inheriting from SCompoundWidget, I do not have direct access to the world. If anyone knows the best way to spawn an Actor from a custom widget, that would be awesome!
asked Feb 26 '19 at 10:37 PM in C++ Programming
What is your Custom Editor Window? Is it a custom UE4 editor window? Or an in-game-editor window? Not really clear.
Since your talking about widgets, I will assume it's the later. In this case, you want the widget to fire off an event in the level blueprint. For this, you will need an event dispatcher.
In the widget you add an event dispatcher, and in the level blueprint you bind an event to that dispatcher.
Check out this vid: https://www.youtube.com/watch?v=9uweDnKGbG8
Follow this question
Once you sign in you will be able to subscribe for any updates here