I have sphere mesh actor with enabled physics. Sphere moving by physics, but vector GetActorLocation() never changes.
Here is code:
void APuppy::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
this->playerController = (AMyFriendsLuckyPuppyPlayerController*)UGameplayStatics::GetPlayerController(GetWorld(), 0);
this->football = this->playerController->getFootball();
FVector footballLocation = this->football->GetActorLocation();
float footballX = footballLocation.X;
float footballY = footballLocation.Y;
float footballZ = footballLocation.Z;
UE_LOG(LogTemp, Warning, TEXT("X: %f Y: %f Z: %f"), footballX,footballY,footballZ);
}
Here is output:
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000
LogTemp:Warning: X: 430.000000 Y: 180.000000 Z: 350.000000