.h File
protected:
virtual void BeginPlay() override;
.cpp File
void AExampleActor::BeginPlay()
{
Super::BeginPlay();
// Your code here...
}
Make sure that PrimaryActorTick.bCanEverTick
is set to true
in the constructor, so the tick function will be called.
.h File
public:
virtual void Tick(float DeltaTime) override;
.cpp File
void AExampleActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
// Your code here...
}
AActor* ExampleActor;
FVector NewLocation;
ExampleActor->SetActorLocation(NewLocation);
AActor* ExampleActor;
FRotator NewRotation;
// Convert FRotator to FQuat and set actor rotation
ExampleActor->SetActorRotation(FQuat::MakeFromRotator(NewRotation));
AActor* ExampleActor;
FVector NewScale3D;
ExampleActor->SetActorScale3D(NewScale3D);
AActor* ExampleActor;
FVector NewLocation;
FRotator NewRotation;
FVector NewScale3D;
// Create FTransform (rotation, location and scale)
FTransform NewTransform(NewRotation, NewLocation, NewScale3D);
ExampleActor->SetActorTransform(NewTransform);
Set Actor Hidden In Game
AActor* ExampleActor;
bool bHideActor;
ExampleActor->SetActorHiddenInGame(bHideActor);
AActor* ExampleActor;
ExampleActor->Destroy();