Im trying to create a TArray pointer to store a link to a const TArray reference outputed by a Reference Skeleton.
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Components/ActorComponent.h"
#include "SpriterSkeletonComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class SPRITEREPICTEST_API USpriterSkeletonComponent : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
USpriterSkeletonComponent();
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
UPROPERTY(BlueprintReadOnly) // ERROR: Inappropriate '*' on variable of type 'TArray', cannot have an exposed pointer to this type.
TArray<FTransform>* BoneTransforms;
TWeakObjectPtr<USkeletalMeshComponent> SkeleComponent;
};
Tried putting the “*” inside of the <> and i get the same Error.
This is the code for obtaining the data.
SkeleComponent = (USkeletalMeshComponent*)GetOwner()->GetComponentByClass(USkeletalMeshComponent::StaticClass());
BoneTransforms = SkeleComponent->SkeletalMesh->RefSkeleton.GetRefBonePose(); // RETURNS: const TArray<FTransform>&