PlayerComponent = CreateDefaultSubobject<UStaticMeshComponent(TEXT("PlayerComponent "));
PlayerComponent ->SetupAttachment(RootComponent);
.
.
.
void APlayerPawn::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
FQuat quat = GetActorLocation().ToOrientationQuat();
//UE_LOG(LogTemp, Warning, TEXT("MyCharacter's Location is %f"), rotation);
OurVisibleComponent->SetWorldRotation(quat);
{
if (!CurrentVelocity.IsZero())
{
FVector NewLocation = GetActorLocation() + (CurrentVelocity * DeltaTime);
SetActorLocation(NewLocation);
}
}
}