Hello! I’ve been following this tutorial to better understand how UE4 c++ code work and I’ve had some trouble understanding some things with CreateDefaultSubobject and pointers.
in the header file i have
protected: UPROPERTY(EditAnywhere) class USpringArmComponent* OurCameraSpringArm; class UCameraComponent* OurCamera;
in the .cpp file
OurCameraSpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraSpringArm")); OurCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("GameCamera"));
CreateDefaultSubobject seem to be creating an object and we’re assigning it to where OurCameraSpringArm and OurCamera are pointing? But why aren’t we dereferencing them? thanks guys