UE5 C++ Blueprint Specifications Reference *Generated by GPT - accuracy not verified*
Core Blueprint Exposure Macros
These macros and annotations are used to expose functions, variables, and classes to Blueprints:
- UCLASS(): Used to declare a class as a UObject-derived class for UE5.
- UFUNCTION(): Declares a function to be exposed to Blueprints.
- UPROPERTY(): Declares a variable to be exposed to Blueprints.
- USTRUCT(): Declares a struct that can be exposed to Blueprints.
- UENUM(): Declares an enum for Blueprint exposure.
- UINTERFACE(): Declares an interface for Blueprint exposure.
Function Specifiers
Specifiers for UFUNCTION() macros to control Blueprint behavior:
- BlueprintAuthorityOnly: Function can only be executed on the server.
- BlueprintCosmetic: Function can only be executed on clients.
- BlueprintImplementableEvent: Declares a function that is implemented in Blueprints.
- BlueprintNativeEvent: Declares a function with both C++ and Blueprint implementations.
- Server, Client, NetMulticast: Specifies network replication behavior.
- Reliable, Unreliable: Defines the reliability of replicated functions.
Variable Specifiers
Specifiers for UPROPERTY() macros:
- EditAnywhere: Allows the property to be editable in the editor and sub-objects.
- EditDefaultsOnly: Property is editable only on default objects.
- EditInstanceOnly: Property is editable only on instances.
- VisibleAnywhere: Read-only in all contexts but visible in the editor.
- VisibleDefaultsOnly: Read-only and visible only on default objects.
- Transient: The property is not saved to disk.
- Replicated, ReplicatedUsing: Marks a variable for network replication.
- Config: Variable is serialized to configuration files.
Class Specifiers
Used in UCLASS() macros:
- BlueprintType: Makes the class usable as a type in Blueprints.
- Blueprintable: Allows the class to be subclassed in Blueprints.
- NotBlueprintable: Prevents the class from being subclassed in Blueprints.
- Abstract: Prevents instantiation of the class directly.
- MinimalAPI: Exposes only minimal APIs for the class to other modules.
- Config: Indicates that the class has associated configuration properties.
Reserved Keywords for Networking
For networked gameplay:
- Net: Marks a variable for replication.
- ReplicatedUsing: Specifies a function to be called when a variable is replicated.
- NetMulticast: Marks a function to be called on all clients.
- Server: Marks a function to run only on the server.
- Client: Marks a function to run only on the client.
You can add metadata to macros for more control:
- DisplayName: Specifies the display name in Blueprints.
- ToolTip: Adds a tooltip for the function or variable.
- DefaultToSelf: Sets a default value of
self for a function parameter.
- AdvancedDisplay: Marks parameters or variables as advanced, hiding them by default.
- BlueprintInternalUseOnly: Hides the function from normal Blueprint usage.
Reserved Words
UE5 reserves certain words for internal use; avoid using them as identifiers:
- Default
- None
- Self
- Root
- Transient
- Config
- Editor
- World
- GameInstance
- Actor
- Component
- Pawn
- Controller