Can not change CollisionResponseToChannel for CapsuleComponent in C++

UE4 (4.23); VS2017 PRO

This Code compiles w/o any errors, but in game it does not change anything.

// ** CoopGame.h
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"

#define COLLISION_WEAPON            ECC_GameTraceChannel1

// *** end of CoopGame.h

#include "SCharacter.h"
#include "Camera/CameraComponent.h"
#include "Components/InputComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Engine/World.h"
#include "Components/CapsuleComponent.h"
#include "Public/CustomProjectile.h"
#include "Components/CapsuleComponent.h"
#include "CoopGame.h"
#include "Public/SWeapon.h"

    // make capsule to ignore Weapon`s damage (projectiles)
    GetCapsuleComponent()->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Ignore);
    GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Ignore);

My Scrennshot:


I will appreciate any help, Thank you!

Did you add the COLLISION_WEAPON to to the Trace Channels in the Editor?

My example is COLLISION_HEAD, but its no different depending on your collision channel number…

Sorry, I forget to post this screen, but I had it in my Project.:frowning:


for now, I have set it in the editor. but this is not very handy. I would like to set it from C++