Variable Exposed To Spawn Not Being Set at Begin Play?
(round 2 typing this because internal errors)
I have a variable Tick Rate expose to spawn that isn't being set when Begin Play is called. I want this to set the tick rate to a desired level right at object creation time.
This is still an issue now on the C++ side. I have a C++ version of my actor component I'm spawning in blueprint, and variables exposed to spawn ARE NOT being set before Begin Play is called. This is resulting in hard crashes because object references are not being set before being accessed.
For whatever reason, passing through this delay node first allows exposed variable to be set properly even when its set to 0 delay. May not even have to be a delay node, but connecting Begin Play to Set Tick Interval somehow executes first before my Tick Rate is set.
answered Feb 14 '17 at 11:15 AM
There are a few similar questions and some answers on the hub. Having recently run into this behavior I summarized what I found in this response: https://answers.unrealengine.com/questions/536784/expose-on-spawn-doesnt-work-for-custom-components.html#answer-661527
Note the linked answer has a dev-side answer, which essentially says, it is an order-of-operation problem. I suspect solving this issue is not trivial in the backend infrastructure. However as a developer I know that software problem problems can be solved by adding yet another layer of abstraction... which could have drawbacks... performance... complexity. Still it would be nice to get it fixed.
answered Jul 04 '17 at 06:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here