UClass in Unreal Engine C++



Exposes a class to Unreal's reflection system

Syntax

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "MyObject.generated.h"


UCLASS(Blueprintable, BlueprintType)
class MYPROJECT_API UMyObject : public UObject
{
	GENERATED_BODY()
	
};

All Specifiers

Blueprintable  // Allows blueprint to instance from this class

BlueprintType  // Allows class to be used in variables inside blueprints

BlueprintSpawnableComponent  // (If class is a component) Allows the class to be instantiated in the Component Tree Panel 

Abstract  // Does not allow the class to be instantiated

Meta Specifiers

DisplayName = "My Class"  // Allows class name to be different inside editor