Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UE4 error compiling due to unknown function EditAnywhere

I've been working on an Unreal Engine 4 game using C++ and I've been working on a dash function, however I followed a YouTube tutorial and I noticed that in the video, they use the function "EditAnywhere" but when I tried to code that my self, my UE4 says that EditAnywhere is unknown function.

Do I need to meet some special requirements to be able to use the "EditAnywhere" function?

My Header file sample code:

UFUNCTION()
void DoubleJump();

UPROPERTY()
int DoubleJumpCounter;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
float JumpHeight;

UFUNCTION()
void Sprint();

UFUNCTION()
void Walk();

UPROPERTY(EditAnywhere)
float WalkingSpeed;

UPROPERTY(EditAnywhere)
float RunningSpeed;

UFUNCTION(EditAnywhere)
void Dash();

UPROPERTY()
bool CanDash;

UPROPERTY(EditAnywhere)
float DashStop;

UPROPERTY()
FTimerHandle UnsedHandle;

UFUNCTION()
void StopDashing();

UFUNCTION()
void ResetDash();

Here is a picture of the Error message enter image description here

like image 631
Technika číslo 1 s.r.o Avatar asked Sep 17 '26 22:09

Technika číslo 1 s.r.o


1 Answers

You can not have the EditAnywhere for functions!

The EditAnywhere is a property declaration meant only for the variables.

Properties are declared using standard C++ variable syntax, preceded by the UPROPERTY macro which defines property metadata and variable specifiers.

UPROPERTY([specifier, specifier, ...], [meta(key=value, key=value, ...)])
Type VariableName;

Do I need to meet some special requirements to be able to use the "EditAnywhere" function?

Editing functions does not make any sense, but you can specify the function how to act in different places(Example: blueprint, unreal editor, etc). This has been done via UFUNCTION declaration. See the different declarations in the given link for further read.

like image 197
JeJo Avatar answered Sep 20 '26 11:09

JeJo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!