HI
I Want Attache Capsule Component By Monster Left Hand
I will Make Monster Attack System By IMage
- Monster Attack Event Call
- Attack Comp Loder GetComponent() According to Event Index
- Component Action
But I Make Capsule Component In AttackCompLoder
But Capsule Component is Not Attached to want Point
Red Circle, I want point to attach CapsuleComponent
this is my code
void AMonsterBase::BeginPlay( )
{
AttackCompLoader = GetWorld()->SpawnActor<AAttackComponentLoader>();
AttackCompLoader->AddAttackComp( TEXT( "LHand" ), this,10.f, 10.f );
}
void AAttackComponentLoader::AddAttackComp( const FName& AttachSocketName, AMonsterBase* Parent, float InRadius, float InHalfHeight ) {
UAttackComponent* AttackComp = NewObject<UAttackComponent>( UAttackComponent::StaticClass());
AttackComp->RegisterComponent( );
AttackComp->SetCapsuleRadius( InRadius );
AttackComp->SetCapsuleHalfHeight( InHalfHeight );
AttackComp->SetRelativeLocation( FVector( 0, 0, 0 ) );
FTransform TempTransForm;
Parent->AddComponent( FName( "AttackComp" ), false, TempTransForm, AttackComp );
AttackComp->AttachTo( Parent->GetMesh(), TEXT("LHand") );
AttackCompArray.Add( AttackComp );
}
In Editer
I Can See AAttackComponentLoader::AttackCompArray Data
But Component Is Not Attached that I want Socket(Position)
What should I do.