EditAnywhere isn't defined in my project

Hello, so I’m trying to implement a MovingPlatform actor class to my UE 5.1 project. I’ve set up the project to use my VS 2022 IDE as the editor and everything seems to compile with just a non-changed standard class of the actor. My problem is that when I try to use the UPROPERTY and pass into the argument “EditAnywhere” it appears as if it doesn’t exist. I checked the UE 5 documentation for setting up VS for the engine but it didn’t work. I tried recreating the project and followed the videos carefully but still. Does anyone have an idea on why my intellisense can detect everything in the Unreal API except EditAnywhere?

Because it doesn’t. The macro doesn’t do anything in C++, it expands to nothing. It’s simply parsed by the Unreal Header Tool.

Unreal does provide enums with the specifiers as enumerators just for the sake of autocomplete.

The property specifiers are in the namespace UP and functions in namespace UF. So if you do using namespace UP (or UF) your IDE should give you autocomplete for it.

1 Like

Thanks man, that sure did the trick! But do you mind explaining a bit about this Macros, UHT, and how they interact with each other and how that tied to the problem? You don’t have to if you don’t have the time; I just wanted to learn from this next time it happens.

Macros are just a textual replacement. The UMACROS replace anything you put into it with absolutely nothing

UPROPERTY(EditAnywhere)
int32 Foo;

Would therefore expand to

int32 Foo;

The UHT is a program that is run before compiling and will parse those macros to generate code. The .generated.h being one of them.

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

Privacy & Terms