Try this.
UPROPERTY(EditDefaultsOnly, Category = "Base Character")
class USpringArmComponent* SpringArm;
UPROPERTY(VisibleAnywhere, Category = "Base Character")
class UCameraComponent * CameraComp;
UPROPERTY(VisibleAnywhere, Category = "Base Character")
class UArrowComponent* TraceDirection;
You may need to include the headers for those classes in the CPP.
#include “Camera/CameraComponent.h”
#include “GameFramework/SpringArmComponent.h”
You can usually find the location of the headers on the class’ API doc page.
Levenlol
(Levenlol)
3
Hi I’ve just downloaded the 4.16 version and I was starting some testing but I got stuck with this simple lines of code:
I’ve created a BaseCharacter class based on ACharacter and I wanted to add a springarm, a camera and an arrow componenet but i got this error:
this is the code I’ve wrote:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "BaseCharacter.generated.h"
UCLASS()
class NOTANOTHERTRY_API ABaseCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
ABaseCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UPROPERTY(EditDefaultsOnly, Category = "Base Character")
USpringArmComponent* SpringArm;
UPROPERTY(VisibleAnywhere, Category = "Base Character")
UCameraComponent * CameraComp;
UPROPERTY(VisibleAnywhere, Category = "Base Character")
UArrowComponent* TraceDirection;
};
Does anyone could help me finding out what’s going on ?
Levenlol
(Levenlol)
4
yep that’s working. but in cpp how do i add the UCameraComponent header or the springarm ? i cannot find em