Hi everyone,
I’m looking for away to check in C++ if the user entered the appropriate Custom Trace Channel name used in one of the classes. Is there a way to do that?
Hi everyone,
I’m looking for away to check in C++ if the user entered the appropriate Custom Trace Channel name used in one of the classes. Is there a way to do that?
Basically you pass in the ECC_GameTraceChannel with the correct index 1 -18, those are the custom ones you defined in the editor
For instance
FHitResult ATracer::DoTrace(FVector start, FVector end) {
FHitResult result;
FCollisionQueryParams qp;
FCollisionResponseParams resp;
GetWorld()->LineTraceSingleByChannel(result, start, end, ECollisionChannel::ECC_GameTraceChannel1, qp, resp);
return result;
}
Would hit the first custom trace channel
Remember to set trace to block for the custom channel on the object that is supposed to be tested against.
I’m using the ECC_GameTraceChannel ofcourse. I just want to make sure the user is setting up himself with the correct name.
Then I guess you could try
You can see binding between ECC_GameTraceChannelX & in-editor names in your project’s DefaultEngine.ini
. They looks like:
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Overlap,bTraceType=False,bStaticObject=False,Name="MyCustomCollisionChannelName")
Then you can just create a header with
#define ECC_MyCustomCollisionChannelName ECC_GameTraceChannel1