Blueprint Interface - Function Import Failed
I am having a problem with one of my Blueprint Interfaces. I have a MainMenuItem BP that uses an interface with a couple functions that a MainMenu BP, which acts like a manager, operates on. I recently added a SetOpactiy(float Alpha) function to my BP interface and it is not getting called when I fire the Interface Message. The weird part is all the other functions within my interface work fine.
I remember having an issue where I think I received a crash and following that is when this occurred. I saw another thread where someone reported this but it seems as though a proper solution/fix was never determined. Here was the link (https://answers.unrealengine.com/questions/74088/reports-of-failed-import-function-interface-incorr.html). But I have the same issue now whenever I enter my map, I get this and then it never fires. I have tried completely deleting this function and it's associations but after re-creating it, it didn't resolve this issue and now after loading the map for the first time today to work on this, I am greeted with the following error in the Log Window...
Error Failed import: Function /Game/Core/Interfaces/MainMenuItemInterface.MainMenuItemInterface_C:Set Opacity in /Game/Core/Blueprints/MainMenuItem
UPDATE: Okay, it didn't fire because of a mistake I made. I was sending in the ChildActorComponent and forgetting to call Get Child Actor prior to calling an interface message on it. So it works, but I'm still getting these errors when going to the level for the first time. It appears to be a false error since it is working but let me know what you need from me to help you solve this in case this is being reported falsely. Thanks again!
Shadowriver, I am going to take my time to respond to you this once more and try to make this a constructive post. I understand you are a beginner to programming and there is nothing wrong with that at all and I appreciate you coming onto this thread to attempt to help me, I really do and I do anyone.
Trust me, you will definitely learn over time the value to using interfaces and as I posted above, you can reach out to Epic and ask them why they are even an asset type within the engine if you want to know more or are confused. Epic is very responsive and will take the time to fill you in. But that wasn't the point of this thread, it was to solve the error I am seeing.
I have been a programmer for quite a while and I do understand the value of base classes and nowhere did I say in this thread that I wasn't using them as I am constantly throughout my code. But I am at a very critical stage in my project where native types/interfaces are avoiding what are called circular-dependencies between other Blueprints that are composed completely within the editor.
This is explained in the documentation and you can read about it there but if you have multiple BPs relying on each other and you are doing a lot of "casting" (ie. 'Cast To MyActor'), then then engine can run into major issues potentially. It has happened to me and it can get nasty. I personally cant afford any more of these issues so I've started switching over to use interfaces in those cases to communicate with those functions from another BP. But if you have classes that are purely C++, then you can cast to them all day long without an issue. You can do a search here on the forums and you will find people primarily use interfaces to avoid those same issues.
I hope that could make a little more sense about things. Good luck with everything and if you ever have any questions that I can help answer, feel free to reach out to me on the forums.
Follow this question
Once you sign in you will be able to subscribe for any updates here