Changing Blueprint interface const status won't sync with its implements

When change the const switch in a function of blueprint interface, it will not change its implementations on compiling interface.

Steps:

  1. Create a Blueprint Interface called “A”.
  2. Add a Function “Foo” in it.
  3. Compile A and save.
  4. Create a Blueprint Actor Class called “B”.
  5. Set B to implement A.
  6. Compile B and save.
  7. In A, set Foo to const.
  8. Compile A and save.
  9. In B, you will find that you cannot call Foo internally because it’s not const.(You cannot set it anywhere)

PS: Moreover, if you create a new Blueprint Actor C, set C to implement A, you can call Foo internally because it is const, which means the status of const will not update to any of its implements.

Hello,

I have attempted to reproduce the issue, but I’m not seeing the same error message. When are you getting this error message to appear? Is it when you are attempting to compile after placing a call to your function inside of your blueprint?

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

This is still a problem. I was using an interface that originally had functions set to const. I created new blueprints that implemented this interface and it worked fine. The problem happens when going back and changing an already utilized interface so that it’s functions are no longer set as const. After saving the interface, any new blueprints that implement the interface are seeing its functions as not const (which is correct), but previous blueprints that had been implementing the interface still have the interface functions set as const. Can’t find a way to re-implement the interface to clear out the const flags.

I’ve attempted to reproduce the issue, but I’m not seeing an error message, just a warning.

Which version are you currently working in?

This has been an issue as since 4.10 at least. It does this on 4.12, 4.13 etc.
You’ll see that warning msg if you’ve followed the steps and try to change the state of an outside variable or event within the interface’s function. That is expected behaviour for a const function…the problem is that you can’t change the interface’s functions to NOT be const after you’ve implemented that interface on some other blueprint that is using those functions already

Out of curiosity, could you post a screenshot of your interface as well as a screenshot of the blueprint that you are implementing it in?

Also, have you tried removing and re-adding the interface through the class settings of the blueprints that are using it?

Removing and re-adding the interface will always work to change the interface’s function settings to be correct, however doing so will either blow away all your current blueprint’s function implementations, or if you tell it to copy the functions from the interface being removed to your blueprint, you can’t go back and re-implement the interface because the functions you just copied over are the same name. I was forced on several occasions to copy all my interface implementing blueprint’s functions to a renamed function name, then remove the interface implementation, then re add the interface, then copy back all my saved functions back into the newly re-added interface functions in order to get the correct function settings on the interface. huge pain in the but.

Hey patch24,

Thanks for the information; however, I’m still not experiencing any error message on my end.

Here’s what I’ve done:

  • Created a new interface
  • Created a new actor
  • Implemented the interface in the actor
  • Set the interface’s function to const
  • Placed a function call in my actor

These steps caused no error to appear. I also did the opposite of starting the function as const and then changing it to be non-constant.

Could you please provide a full list of repro steps that we can use to reproduce the issue in a clean project?

Do this.

  • Create a new interface, add a few const functions to it with return node bools added.
  • Create a new actor BP that implements this interface
  • On this new actor BP use those interface functions by adding some functionality to them (at this point they are marked as const functions in this actor’s implemented functions). Do some math calculations or something.
  • Add a variable to the actor BP (not a local var in one of the functions). Compile and save everything
  • If you try to effect this actor’s variable thru one of the implemented const functions, you will get the error message saying that you can’t change the read only property. Once again, this is expected behaviour for a const function and not what this post has ever been about. The error message is expected for this type of function.
  • Now go back and try to change the original interface functions to not be const functions
  • Watch what happens with the functions that the implementing actor BP is using, they will still be considered const functions and not let you change that actor BP’s variable even though you changed those functions to not be const in the original interface. This is the crux of the issue -getting your actor’s BP to now see the updated interface functions.

.

Hey patch24,

Thanks for the clarification. I was able to reproduce your issue and have entered a bug report, which you can track the status of here: Unreal Engine Issues and Bug Tracker (UE-38358)

Thanks for your report.

Have a great day

I’d like to add that i just got the exact same issue as of 4.16. Started with a const function, tried to restart the editor and it would still not update after i made it not const. I had to delete the interface from my object and readd it.

Cheers