Download

Collision Channel Problem

Hey! I am trying to create a weapon script based on the “ShooterWeapon” example. I am just having a small problem with this collision channel line:


Mesh3P->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Block);

In the project settings for the “Shooter” example game, there is a trace channel called “Weapon”. Is this line referring to that channel? Or how can I understand this line? Because when I tried to do something similiar in my own project, I got a compile error. Would really appreciate if someone could help me with this! Thank you in advance :o

Dear Borzi,

ShooterGame/Public/ShooterGame.h

Check out the above file!

Find your game .h and then add this


/** when you modify this, please note that this information can be saved with instances
 * also DefaultEngine.ini [/Script/Engine.CollisionProfile] should match with this list **/
#define COLLISION_WEAPON		ECC_GameTraceChannel1
#define COLLISION_PROJECTILE	ECC_GameTraceChannel2

Done!

:slight_smile:

Rama

Thank you very much Rama! Could I just ask you what exactly I have done here? And is it dependant on the collision presets that I have made in the editor?