Hi everyone,
I am trying to expose the properties of UCameraShake, which is inherited from UObject, from an Actor class like this:
In BasePlayer.h:
public:
// Sets default values for this character's properties
ABasePlayer();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
// Action Components
UPROPERTY(BlueprintReadOnly, EditAnywhere)
UStructureSpawnComponent* SpawnComponent;
UPROPERTY(BlueprintReadOnly, EditAnywhere)
URockManager* RockManager;
/** The MainCamera attached to the Player...*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Camera)
UCameraComponent* MainCamera;
/** The SpringArm dictating Camera movement properties...*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Advanced)
USpringArmComponent* CameraSpringArm;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Score, Collectible")
UScoreComponent* ScoreComponent;
// The camera shake
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay")
UCameraShake *Camerashake;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
bool InSpawnArea;
In the ctor of BasePlayer:
// Sets default values
ABasePlayer::ABasePlayer() : Super()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
MainCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("MainCamera"));
//Create a spring arm to attach camera to player.
CameraSpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraSpringArm"));
// Attach our camera and visible object to our root component. Offset and rotate the camera.
MainCamera->AttachTo(CameraSpringArm, USpringArmComponent::SocketName);
SpawnComponent = CreateDefaultSubobject<UStructureSpawnComponent>(TEXT("SpawnComponent"));
RockManager = CreateDefaultSubobject<URockManager>(TEXT("Rockmanager"));
ScoreComponent = CreateDefaultSubobject<UScoreComponent>(TEXT("Score"));
Camerashake = ConstructObject<UCameraShake>(UCameraShake::StaticClass());
}
But then in the BP i can’t see the properties of camerashake exposed, neither the object itself, while the components obviously show up:
I have read in other posts that they could achieve this. If you open these two links, you’ll see peoeple posting screenshots of what I want to achieve:
[link text][3]
[link text][4]
Thanks in advance to everyone!