I have character with sword as one mesh. In sword i have bone with socket.
Inside character i create UBoxComponent like this:
WeaponHitBox = CreateDefaultSubobject<UBoxComponent>(TEXT("WeaponHitBox"));
WeaponHitBox->SetCollisionObjectType(ECC_GameTraceChannel3); //Special TraceChannel for melee.
WeaponHitBox->SetCollisionResponseToAllChannels(ECR_Ignore);
WeaponHitBox->SetupAttachment(GetMesh(), TEXT("HitBoxSocket"));
WeaponHitBox->OnComponentHit.AddDynamic(this, &ATwoPlayer::Server_OnHitBoxHit);
When left mouse button clicked, i run animation and WeaponHitBox moves with this animation.
Also when animation starts, i enable collision for WeaponHitBox like this:
WeaponHitBox->SetCollisionResponseToChannel(ECC_Pawn, ECR_Block);
So i want to “Hit” mesh of other character.
Mesh setup:
GetMesh()->SetCollisionResponseToChannel(ECC_GameTraceChannel3, ECR_Block);
So Mesh is blocking GameTraceChannel3, WeaponHitBox blocking Pawn and WeaponHitBox’s object type is GameTraceChannel3.
For some reason i can’t get any hit events. Any ideas why? My setup is wrong?