- Create a new Actor class in the editor called PropertySpecifierActor:
- Add the following property definitions to the class:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PropertySpecifierActor.generated.h"
UCLASS()
class CHAPTER_09_API APropertySpecifierActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APropertySpecifierActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Property Specifiers
UPROPERTY(EditDefaultsOnly)
bool EditDefaultsOnly;
UPROPERTY(EditInstanceOnly)
bool EditInstanceOnly;
UPROPERTY(EditAnywhere)
bool EditAnywhere;
UPROPERTY(VisibleDefaultsOnly)
bool VisibleDefaultsOnly;
UPROPERTY(VisibleInstanceOnly)
bool VisibleInstanceOnly;
UPROPERTY(VisibleAnywhere)
bool VisibleAnywhere;
};
- Perform a Save, Compile your code, and launch the editor.
- Create a new blueprint based on the class.
- Open the blueprint and look at the Class Defaults section:
- Note which properties are editable and visible under the Property Specifier Actor section:
Location of the Property Specifier Actor
- Place instances in the level and view their Details panels:
- Note that a different set of properties is editable.