Create a new actor called “MyOtherActor,” and give it a variable that holds a reference to a “MyActor.” Again, call “MyActor.MyComponent.MyFunction()” in the “BeginPlay” event of this new actor.
Change “MyComponent” in some way (I just added an extra boolean variable to it.
Recompile “MyComponent.”
Notice that there is a transient compiler error in “MyActor.” This is annoying, but not fatal. “MyActor” can be recompiled with one click.
However, notice also that the pin from the referenced “MyComponent” to “MyFunction()” has been disconnected in “MyOtherActor.” This is fatal, as it will stop compilation for any and all blueprints which reference the component indirectly like this. It also causes hidden logic errors if the component was, say, passed as a function parameter instead. Such an error will not generate a compiler error, but will cripple the game’s logic.
In the long run, I feel that it would be better to throw compiler errors than to ever disconnect a pin automatically. Disconnecting pins is the equivalent of automatically rewriting lines of source code, and it’s not even remotely close to okay. I shudder to think of what other logic errors may have snuck into my game due to issues like this that I have failed to catch.
Thanks for reporting this to us. I followed your reproduction steps closely and I see that you’re provided with an error however I am not when I make a change to the ‘MyComponent’ blueprint. I added in a boolean and even attached it to the printstring from ‘My Function’ and no errors have appeared in either of the blueprints.
Have you been able to reproduce this each time you follow these steps? If so, would you mind zipping the blueprints and providing them to me so I can include them in a new project and compare ours and see what the difference may be?
I appreciate your time and look forward to hearing from you, thanks!
I’l do you one better than that. I’ve attached a blank project with blueprints that can reproduce the problem in UE 4.8.1. To reproduce:
Open the project
Open MyActor and MyOtherActor (this is apparently an important step, and is likely why you couldn’t reproduce it. It doesn’t fail if the blueprints are not open in the editor.)
Open MyComponent and add a new boolean variable (default name is fine).
Compile MyComponent
Look at MyActor and MyOtherActor to see the errors.
You’re probably correct. I may have closed out the blueprints when attempting this which did not cause the issue. I have however been able to reproduce this within your project that was provided and my own. I have submitted a report referenced as: UE-18430.
Thank you again for noticing this issue within the blueprint editor. If you have any further questions or concerns, please feel free to post a new question to AnswerHub!
No problem! Thanks for being so responsive. Now that I’ve learned that it only happens if the blueprints themselves are open though, I at least have a workaround. I’ll just be careful until the fix is released.
UE-18430 was not ready for 4.9 however, it’s currently scheduled for 4.10 but it’s not resolved yet, so that could change at any time. Feel free to ask again in a few weeks.