BindUFunction failed to find function

Hey i got a runtime error, saying “Failed to find function TurnBackToSpawner in TitanSpinningAxe…”
It doesnt find the function which i provided inside of fname() but its inside of the same cpp file

Is TurnBackToSpawner defined in your .h file and is it marked as a UFUNCTION()? Any function you’re binding in anyway should always be marked as UFUNCTION().

It’s easier to see your code & errors if you paste them in rather than screenshot so if the above isn’t right, maybe doing that will help us find your problem.

2 Likes

Thanks, its now working. So what the UFUNCTION() adds to my func?

UFUNCTIONS are used to expose your methods to the Unreal System. I think of it like using Reflection systems in C# although it’s not strictly true.

Best way to decide if you need a UFUNCTION or not:

  1. Do you want to call this method in a blueprint?
  2. Should this method act as an event to call some blueprint code?
  3. Is this method being bound in any way?

If the answer to any of these is yes, add a UFUNCTION. In case 1 and 2, you’ll also need some additional specifiers such as BlueprintCallable or BlueprintImplementableEvent. More information on this is here: UFunctions | Unreal Engine Documentation

Whilst you’re at it, look at UCLASS and UPROPERTY too.