void UPositionReport::BeginPlay()
{
Super::BeginPlay();
FString ObjectName = GetOwner()->GetName();
FString ObjectPos = GetOwner()->GetTransform().GetLocation().ToString();
UE_LOG(LogTemp, Warning, TEXT(" %s is located at %s"), *ObjectName, *ObjectPos);
}
I’m a little confused. Is ObjectName and ObjectPos a variable or the name of the pointer? I’m not sure as the use is identicle to assigning a variable but as the name of a pointer it’s the only way that *ObjectName and ObjectPos makes sense to me. In my mind I think
FString ObjectName* = GetOwner()->GetName();
makes more sense to me so I’m confused. Should I just think of it as anytime you use a -> to drill down you give the pointer a name then usePointerName to access it?
Sorry I’m new to programming so I’m trying to wrap my head around this very important topic and I learn best if I understand why something is then just remembering a seemingly arbitrary rule. If someone could just break down what is going on here as far as the pointer logic is concerned I would be greatful. Thanks!