[BUG] Delegate in Blueprint Class stops to work after function name change

How to reproduce:

  1. Create a class.
  2. List item
  3. Define some function that will be called as delegate function.
  4. Add UFUNCTION attribute.
  5. Set your delegate function using AddDynamic to some component ( I was using AIPerceptionComp.OnPerceptionUpdated ) in your class constructor.
  6. Create a Blueprint Class A based on that class.
  7. Instantiate an object of Blueprint Class A class.
  8. Make sure that your delegate function is being called properly.
  9. Change name of your function, and recompile.
  10. Your delegate function is not being called anymore.
  11. Change name of your function back to the original.
  12. Your delegate function is being called again.
  13. Change name of your function to new one.
  14. Create w new Blueprint Class B.
  15. Instatniate an object of Blueprint Class B.
  16. The function will be called on object of Class B but not on object of Class A.
  17. Change name of your function to the original one again.
  18. The function will be called on object of Class A but not of Class B now.

I’ve checked the binary files of those Blueprint Classes. The function name isn’t being updated after it was changed and recompiled.

Hey -

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-38419) . You can track the report’s status as the issue is reviewed by our development staff.

Cheers

Thank you. I hope it’ll be fixed soon. It’s quite annoying and hard to find such bugs, and it’s very easy to fall in this specific one.
I assume that there might be something simmilar going on on Blueprint Classes, so probabbly someone should investigate that.

It’s still valid, and it’s really, really annoying. It wastes tens of hours every month in my team!

Hi Krzysiek and ,

Is there any known walkaround to make it work. It’s so frustrating.

Cheers.

No. There is non. The only think you can do ( when you already firured out why your stuff isn’t working ) is to create a new blueprint and delete the old one - that’s it. The bug was already found 4 months ago, and nobody did nothing about it. To me it’s not the only problem connected to blueprint’s serialization and unupdating things. I don’t like that the “Target Fix” version was changed already 3 times on that bug.

Hi all,

Just to update you on this issue, it has been closed without resolution, because it is not possible. The hot reload process cannot know that you have renamed a native function, because there is no way for the hot reload to tell the difference between a renamed function and a function which has been deleted and replaced with a different one which you didn’t want to rebind to. This would lead to data corruption and crashes.

If you want to rename a function, you should add something like this to your game’s DefaultEngine.ini config:

[/Script/Engine.Engine]
+K2FieldRedirects=(OldFieldName="MyActor.OldFunctionName",NewFieldName="MyActor.NewFunctionName")

You’ll need to reload the editor but when you do, all bindings to the old function should be remapped to the new name.

Steve