UStaticMeshComponent* UACarryObjectComponent::GetCarriedMeshComponent() { USceneComponent* ChildComp = GetChildComponent(0); if (ChildComp) { AActor* OwningActor = ChildComp->GetOwner(); if (OwningActor) { return Cast<UStaticMeshComponent>(OwningActor->GetComponentByClass(UStaticMeshComponent::StaticClass())); } } return nullptr; }
AActor* UACarryObjectComponent::GetCarriedActor() { USceneComponent* ChildComp = GetChildComponent(0); if (ChildComp) { return ChildComp->GetOwner(); } return nullptr; }
bool USCarryObjectComponent::GetIsCarryingActor() { return GetChildComponent(0) != nullptr; }