[=]
I might be missing something…is there no way to override an actor component’s constructor with blueprints? (What does the Auto Activate flag do, anyway? I had hoped that it setting it to true would cause the Initialize Component event to act like a constructor – but it doesn’t seem to be the case.)
[/]
InitializeComponent is your rough equivalent to BeginPlay. Is inadequate for what you need?
Activation is something that is used for Audio and Particle components (among a very few others), it also used to be tied to whether a component could tick. The auto activate and tick have been disconnected and hopefully for 4.8 we are going to clean up activation to only exist for the components that actually use it. It had been at the base level in an effort to keep a consistent API for activation, but it has become more confusing given how few components use it.
[]
First, if a component is part of the actor, rather than just attached to the actor out in the level, there’s no way to modify the component’s variables from the level editor. It’s terribly inconvenient. It would be really nice to be able to change those variables on a per instance basis from the level editor. I’m not sure why it works the way it does.
[/]
Are you talking about components defined in the blueprint’s component tree? We did try to make them editable on a per instance basis but it was causing a huge number of bugs and at the last minute we had to disable it. I certainly hope to get it back in for a future release, however, I haven’t had time yet to figure out why the mechanism was causing so many and varied bugs.
[]
Second, if the component is attached to the actor in the level, it’s exposed variables are modifiable, but the editor doesn’t dirty the actor and thus fire it’s constructor when these variables are messed with. I made an exposed boolean on my actor that I can toggle on and off in order to force the constructor to execute (more easily), but again, it’s inconvenient. It’s a couple extra clicks for something that updates wonderfully and automagically when the code is in the actor’s constructor. It’s swank to move a slider and see things happen immediately in the viewport.
[/]
is fixed for 4.8. github/EpicGames/UnrealEngine/commit/5f81ed6b5a0414c7ffa6ae639bdafd0622f2163a
[]
Third, it’s pretty fragile. For example, I ‘accidentally’ deleted an event on a component that was called by the actor’s constructor, and the editor crashed hard. I’ve had some other minor bugs that I believe are caused by the way the components handle circular references, where a level containing an actor attached to a component refuses to save because the component is a ‘private object’.
[/]
Certainly crashing is no good, please put up answer hub posts with repro cases for these (if you haven’t already). The component template in a blueprint certainly may not hold a reference to an actor in the level. A component added via the component tree to a specific instance should be able to, though it is potentially going to cause issues if you promote that instance to a class, if you have a repro case for that kind of error please also put that up on AnswerHub, I’d definitely like to fix it.
Thanks for the feedback.