This is probably a very easy answer, but I am not good at C++ and after going over some tutorials and documentation, I still keep getting errors with this.
All I need to do is get the player character and then find all scene components (on the player) with the tag “GrabObjectPivot” and add those to an array.
void APickupObject::SetPlayerGrabComponents()
{
ACharacter* playerChar = UGameplayStatics::GetPlayerCharacter(GetWorld(), 0);
TArray<USceneComponent*> Components = playerChar->GetComponentsByTag(USceneComponent::StaticClass(), FName("GrabObjectPivot"));
}
I thought this would do the trick, but I keep getting an error saying “no suitable user defined conversion from TArray UActorComponent* to TArray USceneComponent*.” I guess that doesn’t make sense to me because wouldn’t the “GetComponentsByTag” return scene component values based on the actor I put in?