[4.10.0] BP: Function not resolved after copy/paste

When copying a calling node from Blueprint A to Blueprint B, it stops working although there is a function with same name and same signature. Refreshing nodes doesn’t change anything.

error message doesn’t make much sense:


There is no refactoring functionality, so there is no alternative in recreating functions, variables etc. in target class by hand and then trying to copy everything over.

Hi ,

I wouldn’t expect this to work. calling node is referencing a specific function, not name of function. That error message is misleading, so I’ll enter a bug report for that. Other than that, most copying from one blueprint to another can be done, including variables. I could see copying functions from one BP to another being a super useful feature, so I’ll create a feature request for that… but I have no idea how complex that would be. Is there anything else I’m missing, or would error message bug report and function copy feature request cover everything?

Hi , yes I think that covers everything, thank you. Moving methods/events from one class to another has been very error prone in Blueprint ever since.

Cool, I’ll enter those shortly and post an answer here once I have.

One thing I’d like to point out, if you’re not already aware, is Create Variable feature when copying variable nodes:

69097-createvariable.png

This way if you copy a block of nodes and it includes a reference to a variable into a new Blueprint, you won’t have to manually create variable. This doesn’t port over default values, though, but it might help save some time.

Hope that helps a bit, if you didn’t already know about it.

This will really become handy from time to time, thank you.

Hey, so I attempted this in 4.10, and it actually worked. To test, I created two new Actor Blueprints. In ABP1, I created a new function with a bool input. I then called function in event graph. I created a new function in ABP2 with same name and also gave it a bool input. I then copied function call node from ABP1 and pasted it into Event Graph in ABP2. It pasted and compiled without any problems. Am I missing any steps?

This is pretty much exactly what I did. I then just dragged new function into graph and reconnected wires. Strange…

Hm. Happen in a new project as well?

No, doesn’t happen in a new test project for some reason.

only issue is, that a function call node is silently removed without any warning message if a method doesn’t exist in new blueprint instead of creating a placeholder or to copy function as well.

So wait, after this compiler issue, function call nodes that already existed in new blueprint for that function don’t work anymore either? Or am I misunderstanding you? I thought it was a simple matter of copied node not compiling (which I haven’t reproduced yet).

project you see this in was upconverted, yea? How far back in engine versions does it go? Maybe I can reproduce it if I try upconverting projects to 4.10. Did function in original blueprint exist in an earlier version, or was that one also created in 4.10?

Hi ,

Yes, project was converted from 4.9.2 (used a copy). We are talking about two different types of issues:

  • Inside my project (4.10.0) I was able to copy a function call node in a new blueprint as long as there is a function with same signature in target blueprint, but I couldn’t compile it. This seems to work in a newly created project.

  • When there is no function with same signature in target blueprint, calling node just gets silently removed while pasting

Hi again,

got same problem today after copying a bunch of events from level blueprint in referenced target blueprint itself:


All getter and setter nodes where destroyed, too ( ‘target’ to set or get a variable is now class itself, but it’s not possible to re-use nodes, they have to be re-created by hand now). While doing this, editor crashed:
MachineId:E41A3D4D43CC73524EE9A8AD024CD4DFEpicAccountId:fba125fe5ed14161aba130 - Pastebin.com (crash report)

Was trying to copy and paste text of a comment bubble.

,

I’m still looking into this, but haven’t had any luck yet. I’m going to try different BP types than standard Actor. Have you noticed a pattern with specific types of blueprints, or is this universal? Also, function being copied, was that created in 4.9.2 version originally?

crash you got appears to involve comments specifically. I looked it up and apparently something new in 4.10 is causing this crash for multiple people. We’re going to try to get a reproduction based on reports that have come in for it, but I may have more questions about that. It does not appear to be related to issue you’re describing in OP, so I’m skipping that for moment.

We got a repro and a bug report in for that comment crash now (UE-24291). Thanks for bringing it to my attention!

Okay, yea, upping a project from 4.9.2 to 4.10.1 didn’t reproduce issue for me either. I tried copying from Actor, Character, PlayerController, GameMode, GameInstance, and Level BP, all referenced somewhere else (project settings, game mode, etc), into an Actor BP both from 4.9 and a new one from 4.10, and still nothing. I must be missing a step somewhere.

Hi ,

  • original function was created in 4.9.2 (as far as I can remember)
  • it was copied from level blueprint to an actor blueprint. This actor was referenced before from target blueprint, now functionality was moved directly into this actor.

I can reproduce broken-function-call-bug in 4.10.1 as follows (might be a strange example but it works)

  • Create a new actor blueprint called BP_Test
  • Add a class variable of type string called ‘testString’, set ‘test’ as a default value
  • Add a method ‘printSomething’ which looks like this:

  • Open level blueprint
  • Create a graph like this


Test script (should simply write word ‘test’ to console).


Now let’s try to move this functionality from level blueprint into referenced blueprint itself.

  • Copy nodes from level blueprint and paste it into event graph of BP_Test and press compile:


Try to remove broken reference nodes (unknown) and try to refresh all nodes + recompile:


Remove broken variable node and replace it with a fresh getter node:


Even then, function call stays broken and has to be manually replaced.

( other issue is that pasting a function call node into a blueprint which hasn’t that function results in Blueprint editor silently removing node without any message and breaking execution flow)

Does this only happen when copying from a BP with a specific actor reference? So you reference BP2 in BP1 and get a function call from a function in BP2, then copy function call and paste into BP2?

issue with functions not being copied over when there isn’t an existing function is a known thing, and may be intentional. I know it was reported at some point, but I don’t remember specifically what outcome was. I’ll do some research and enter a new bug if necessary.

Hi ,

well, I’m afraid that’s my bug report. Code gets broken after copy & paste and there is currently no alternative to do so because there is no other method to move code to other classes. It’s not only that calling nodes are silently removed but execution flow gets broken also. And sometimes it doesn’t even work if there is a method with same signature. I posted all necessary steps to reproduce this.

If you say this is intentional, well, I honestly don’t know what to say. No offense.

Thanks for investigating, though.

No no, I don’t think that’s intentional at all. I can reproduce behavior in that circumstance, and just want to verify that’s only circumstance it occurs for you before I enter a report.

It actually sounded very familiar, so I found an old post you and I were working on that ended in a bug report:

Not quite same thing, but bug report is exceptionally similar. There’s also another that’s more specifically related to what I described (UE-23696). I’ll probably add some info to that one once you confirm. So is that a yes? This only happens with that specific chain?