Download

Separate "Awake" and "BeginPlay" events to ensure references have been set

I primarily work with Blueprint, and the need to ensure that one actor’s references have all been set before another actor needs to use them has been a serious problem. Unity has an Awake and Start function. Start is called after Awake, allowing references to be setup in Awake before they are needed in Start. The difference having that option makes is incredible. Perhaps I’m missing something, but UE4 doesn’t seem to have any way to do the same in Blueprint, and I strongly suggest implementing one.

btw, begin play is tricky to use, at level blueprint begin play is not when level loaded

Hi OhiraKyou,

Have you tried utilizing the construction script? You can find more information on it here:

I think equivlent of awake would be PostInitializeComponents, which is ealierst event called after components are setup and ready to be manipulated (there also PreInitializeComponents right before that), BeginPlay is actully called right after that event is done, but huge difference between them is that BeginPlay is called only in game play where PostInitializeComponents is called in editor too (when actor is placed). Equivalent of PostInitializeComponents in blueprints is construction script if i’m not mestaken

The construction script isn’t called at runtime for actors placed in the editor. Even in the simplest case of printing a string, you will never see it.