Multiple Function Declarations for same Implementation give Error Message

Hello,
i am pretty new to CPP and following a tutorial.
I have created a UFUNCTION that is BlueprintCallable and then the same function name to create a pure function. Then i get a error message, that my Functions conflic with each other.

.h File:

.cpp File:

Error:

Do i have to create a different Function implementation for this or am i missing something her ?

You cannot have two functions with the same signature. Even if this was a case of utilizing function overloading, it is not supported by blueprints. Since you are following a tutorial, are you sure you are not supposed to make one function that is BlueprintCallable and BlueprintPure? Given your header, I would assume that should be the case. Otherwise your only other option is to give the duplicate function a different name to avoid the conflict.

“Since you are following a tutorial, are you sure you are not supposed to make one function that is BlueprintCallable and BlueprintPure?”

How exactly would i do that?
I tried adding both Specifiers to the Macro but it just took the last one wich in my case was “BlueprintPure”.

Yeah you add both specifiers to a single function declaration. I tend to do this but I also believe that using BlueprintPure implicitly makes the function BlueprintCallable.

What’s the issue with the function being “pure”? Considering the implementations you have shown, it would make sense for them to be marked as such. Maybe you could go more in depth with what it is you are trying to achieve? Or post the relevant section of the tutorial you are following for more clarity. Otherwise I believe that doing what I told you has fixed the original errors.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.