I’m using the editor compiled from Source. Version 4.1.0. I named my project ‘PromoWinter’ and new class isn’t ‘Powerup.h’, but it’s ‘Pizza.h’. But my code is the same as in the video. Almost)
class APizza : public AActor
{
GENERATED_UCLASS_BODY()
UPROPERTY(VisibleAnywhere, Category=Powerup)
TSubobjectPtr<USphereComponent> TouchSphere;
UPROPERTY(VisibleAnywhere, Category=Powerup)
float RotationRate;
virtual void Tick(float DeltaTime) OVERRIDE;
};
and
APizza::APizza(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
PrimaryActorTick.bCanEverTick = true;
TouchSphere = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("TouchSphereComponent"));
TouchSphere->SetSphereRadius(20.f, false);
RootComponent = TouchSphere;
RotationRate = 175.f;
}
void APizza::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
FRotator MyRot = GetActorRotation();
MyRot.Roll += RotationRate * DeltaTime;
SetActorRotation(MyRot);
}
But I think that the problem doesn’t stems from the code, because Visual Studio compile it fine.