Compiler Error for Indirect Blueprint Component References
In UE 4.8.1, I'm experiencing a bizarre Blueprint compiler error. The following steps reproduce the issue:
1) Create a new blueprint-based component called "MyComponent." Give this component a single function called "MyFunction."
2) Create a new actor called "MyActor," giving it a "MyComponent." Call "MyComponent.MyFunction()" in the "BeginPlay" event.
3) 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.
4) Change "MyComponent" in some way (I just added an extra boolean variable to it.
5) Recompile "MyComponent."
6) Notice that there is a transient compiler error in "MyActor." This is annoying, but not fatal. "MyActor" can be recompiled with one click.
7) 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.
This issue can be worked around by using something like the following:
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.
asked Jul 06 '15 at 11:57 PM in Bug Reports
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 Jira 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!
Have a great weekend!
answered Jul 10 '15 at 01:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here