I’m trying to get the location of a child component (StaticMesh), that is simulating physics.
I created a C++Class; type AActor, called myActor.
void AMyActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
FVector myLocation = GetActorTransform().GetLocation();
UE_LOG(LogTemp, Warning, TEXT("MyActor %s"), *myLocation.ToString());
}
I then create a Blueprint based on myActor where I add a Static Mesh Component with Simulate Physics checked.
GetActorTransform().GetLocation() returns the transform to the rootComponent. When I shoot the object with FPS Template Gun, the box flys away, but the location is the same.
How would I go about getting the Transform for the child object (Static Mesh)?
Also, How would I go about getting the Blueprint Class (BP_myActor) from C++ (myActor) ?
Thanks