Transform of a Component added via c++ does not be auto keyed in sequencer. How can i fix it?

As i mentioned in the title, i tried to add a component via c++ and also tried to control it in sequence.

this is the code how i added some component to the actor.

if (UActorComponent* BoneDriverComp = Owner->AddComponentByClass(USpineRigBoneDriverComponent::StaticClass(), false, FTransform(), false)) {
    if (USpineRigBoneDriverComponent* Casted = Cast<USpineRigBoneDriverComponent>(BoneDriverComp)) {

	FTransform Transform = Skeletion->GetBoneWorldTransform(TCHAR_TO_UTF8(*Name.ToString()));
	FAttachmentTransformRules Rule = FAttachmentTransformRules::KeepWorldTransform;


	Transform.SetScale3D(FVector(0.15, 0.3, 0.15));
	Casted->BoneName = Name.ToString();

	Casted->AttachToComponent(this, Rule);

	RigBoneDrivers.Add(Name, Casted);

Those component under the component ‘BongRig’ are the component that added via that code.


so now i tried to modify the transform of each component with Auto-Key system, but for those components add via c++ seems doesn’t recorded properly by Auto-Key marking.

How can i fix this? i think the way i added the component to the actor is the cause… but i can’t find proper solution for this…

It would be great if you share any help for me… Thank you

i somehow find a way to handle this.

void GetActorAndSceneComponentFromObject( UObject* Object, AActor*& OutActor, USceneComponent*& OutSceneComponent )
	OutActor = Cast<AActor>( Object );
	if ( OutActor != nullptr && OutActor->GetRootComponent() )
		OutSceneComponent = OutActor->GetRootComponent();
		// If the object wasn't an actor attempt to get it directly as a scene component and then get the actor from there.
		OutSceneComponent = Cast<USceneComponent>( Object );
		if ( OutSceneComponent != nullptr )
			OutActor = Cast<AActor>( OutSceneComponent->GetOuter() );

i found the function that track down the changes on component transform (F3DTransformTrackEditor::OnTransformChanged) , and i figured out that if the component does not have an actor as its outer , than auto keying on the transform track will not work.

I handled this problem by creating component with NewObject Function with actor outer in.